
74 Wis.2d 681 (1976)
248 N.W.2d 70
MILEWSKI, Plaintiff in error,
v.
STATE, Defendant in error.[]
No. 75-500-CR.
Supreme Court of Wisconsin.
Argued October 7, 1976.
Decided December 14, 1976.
*682 For the plaintiff in error there were briefs and oral argument by Charles Bennett Vetzner, post-conviction defense project.
For the defendant in error the cause was argued by Michael R. Klos, assistant attorney general, with whom on the brief was Bronson C. La Follette, attorney general.
*683 CONNOR T. HANSEN, J.
Three issues are presented for review:
1. Is the defendant entitled to credit on his commitment to the department as a sex deviate pursuant to sec. 975.06, Stats., for preconviction jail detention?
2. Is the defendant entitled to credit on his commitment for time spent at Central State Hospital under temporary commitment for presentence social, physical and mental examination, as required by sec. 975.01, Stats., and for time spent in confinement awaiting a Huebner-type[1] hearing?
3. Is the defendant entitled to credit for time spent at Central State Hospital under a commitment because of incompetency to proceed with sentencing as authorized by sec. 971.14(2) and (5), Stats.?
The defendant was arrested on August 16, 1970, on two charges of indecent behavior with a child and one charge of battery. At his initial appearance on August 17, 1970, counsel was appointed and bail was set at $20,000. The preliminary examination, held on August 26, 1970, resulted in bind-over to the circuit court for trial. On October 2, 1970, defendant was arraigned, pleaded not guilty, and demanded trial by jury. On October 16, 1970, the defendant waived trial by jury. Trial to the court was held on October 21, 1970. The court found the defendant guilty of all three counts as originally charged.
The defendant remained in county jail, presumably because of his inability to post bond, from the time of his arrest on August 16, 1970, to the time of trial on October 21, 1970.
On October 21, 1970, pursuant to sec. 975.01, Stats., the trial court ordered the defendant committed to the department at Central State Hospital (hereinafter CSH) for a presentence social, physical and mental examination, *684 returnable within sixty days, as provided by sec. 975.04.
On December 11, 1970, the defendant returned to the trial court and was informed that as a result of the presentence examination, the department had recommended specialized treatment under the provisions of sec. 975.06, Stats. The defendant requested a Huebner-type hearing to contest the findings and recommendations of the department, and indicated that he would call his own psychiatrist. The Huebner-type hearing was scheduled for January 8, 1971. The defendant remained in the county jail pending the hearing.
On January 8, 1971, at the commencement of the Huebner-type hearing, the defendant indicated that he had dismissed his court-appointed counsel. The trial court, based upon its discussion with the appointed defense counsel and its own observations of the defendant, ordered the defendant committed to CSH pursuant to sec. 971.14 (2), Stats., for a sixty day psychiatric evaluation to determine whether he was capable to assist his attorney in the sentencing phase of the criminal process.
On February 23, 1971, the defendant was returned to the trial court. On the basis of the statements of the appointed defense counsel, all of the previous records and proceedings of the case, and a February 18, 1971, recommendation from the department that the defendant was suffering from a mental disease that impaired his capacity to proceed with sentencing, the trial court adjourned all further proceedings in the matter until a future date, and ordered the defendant committed to CSH pursuant to sec. 971.14 (5), Stats., until his recovery.
On June 14, 1971, the department informed the trial court by letter that in its opinion the defendant was competent to proceed. A Huebner-type hearing was scheduled for June 29, 1971.
*685 On June 29, 1971, the defendant appeared before the trial court with counsel and waived his right to the Huebner-type hearing. Accordingly, the trial court committed the defendant to the department at CSH pursuant to sec. 975.06, Stats., for treatment as a sex deviate, the commitment to run concurrently on each of the three counts on which he had been found guilty.
The defendant filed a sec. 974.06, Stats., postconviction motion requesting the trial court to credit him with various periods of incarceration which he had served prior to his June 29, 1971, commitment as a sex deviate. The trial court denied the motion. This writ of error followed.

PRECONVICTION DETENTION.
The defendant was detained in the county jail from the time of his arrest on August 16, 1970, to the date of his trial and conviction on October 21, 1970, a period of 67 days. The fact that he remained in jail for this period because of his financial inability to post bail is uncontested.
The defendant contends that failure to credit this preconviction jail detention to his ultimate commitment as a sex deviate violates both equal protection and double jeopardy principles of constitutional law.
[1] In Byrd v. State (1974), 65 Wis.2d 415, 424, 222 N.W.2d 696, this court held that the equal protection clause of the fourteenth amendment to the United States Constitution required that preconviction detention which was the result of financial inability to post bail must be credited to a subsequent sentence if the preconviction detention and the subsequently imposed sentence, when added together, exceeded the maximum sentence permitted under the statutes for the offense.
*686 In Byrd, this court recognized and discussed the existence of inconsistent federal case law on the subject of credit for preconviction incarceration, and in State v. Seals (1974), 65 Wis.2d 434, 223 N.W.2d 158, stated at page 436:
"In the Byrd Case the majority of this court rejected the reasoning and result of cases holding that `. . . where, for whatever reason, a defendant remains in jail prior to his trial he must be given credit on the statutorily fixed sentence ultimately imposed for all periods of actual confinement. . . .' [White v. Gilligan (D.C. Ohio 1972), 351 Fed. Supp. 1012, 1014. See also: Monsour v. Gray (D.C. Wis. 1973), 375 Fed. Supp. 786 and Taylor v. Gray (D.C. Wis. 1974), 375 Fed. Supp. 790.] Such holding would require an automatic offset, as to any prison sentence imposed, for all time spent in jail before the sentence was imposed, including both preconviction confinement due to inability or disinclination to post bail or time spent in jail following conviction but before sentencing. Instead, the majority of this court adopted the rule of a federal district court decision finding the essential question to be `. . . whether the time a prisoner spends in custody prior to trial when added to the sentence to be served upon commitment can total more than the statutory maximum punishment for the crime involved. . . .' [Culp v. Bounds (D.C.N.C. 1971), 325 Fed. Supp. 416 at pages 418, 419.] The federal district court holding, under the rule adopted by the majority of this. court, is limited (1) to time spent in custody before conviction, and (2) to cases where such time, added to the sentence imposed, exceeds the statutory maximum punishment. Where the preconviction time in jail added to the sentence imposed does not reach the maximum possible under the statute, the rule and the credit it gives is inapplicable. . . ."
Essentially the defendant contends that the Byrd rule should be applied in the instant case; that a commitment under sec. 975.06, Stats., should be analogized to criminal sentence. This is so, argues the defendant, even though the duration of the commitment, subject to statutorily *687 defined procedures and restrictions, can continue as long as is necessary for the protection of the public.[2] The defendant points out that such a commitment necessarily includes certain conditions of confinement that one would normally consider punitive.
We are not persuaded by this argument. Commitments under the Sex Crimes Law present different considerations than sentences imposed under the penal statutes. The questions of equal protection, due process and double jeopardy must be considered in light of the provisions of the Sex Crimes Law and not the penal sentencing statutes and law.
[2] This court has held that the dual purpose of commitment under the Sex Crimes Act is to protect the public from the commission of dangerous sex crimes and to provide treatment for the dangerous sex offender. Buchanan v. State (1969), 41 Wis.2d 460, 471, 164 N.W.2d 253; State ex rel. Farrell v. Stovall (1973), 59 Wis.2d 148, 161, 207 N.W.2d 809. The over-all constitutionality of the Act in its treatment of the classification of sex deviates has been upheld in State ex rel. Volden v. Haas (1953), 264 Wis. 127, 58 N.W.2d 577; and more specifically in Mitchell v. State (1975), 69 Wis.2d 695, 700, 230 N.W.2d 884, this court held that the classification of offenders as sex deviates did not offend the equal protection clause of the fourteenth amendment.
While a commitment under sec. 975.06, Stats., is triggered by a conviction of criminal offense, the fact remains that such a commitment is not a criminal sentence. In Huebner v. State, supra, in deciding that a hearing was required before an individual could be committed for specialized treatment under sec. 975.06 [then sec. 959.15 (6)], this court stated at page 526:
"`We consider this commitment procedure so essentially different from penal sentencing as to amount to an *688 independent proceeding which determines such important rights of the defendant unrelated to the determination of guilt that due process requires a hearing thereon as much as it does for subsequent hearings on the same issue.'"
In Farrell v. Stovall, supra, at p. 167, this court quoted with approval the following description of a sec. 975.06, Stats., proceeding found in Hill v. Burke (D.C. Wis. 1968), 289 Fed. Supp. 921, 927, affirmed on appeal (7th Cir. 1970), 422 Fed.2d 1195:
"`The commitment proceedings under the statute constitute neither a civil commitment nor a sentencing procedure, but rather an independent criminal proceeding which is triggered by a criminal conviction.' (Emphasis added.) "
In Howland v. State (1971), 51 Wis.2d 162, 186 N.W. 2d 319, the defendant attacked his commitment as a sex deviate upon the grounds that sec. 975.06 [then sec. 959.15 (6)], Stats., provided for cruel and unusual punishment proscribed by the United States Constitution. This court concluded that commitment under the Sex Crimes Act did not constitute cruel and unusual punishment, stating at pp. 174, 175:
"The procedure above described [i.e., the Sex Crimes Act] is not designed to determine the criminal punishment to be imposed but to determine whether treatment and the protection of the public is necessary."
Byrd was concerned with the equal protection aspects of requiring a financially destitute defendant to spend over and above the maximum amount of time allowed by statute, in prison, while a defendant who was able to raise bail, could only be incarcerated for the maximum period. The punishment inflicted in the first instance would necessarily be greater than that in the second instance. But the mere inequalities in punishment, due to *689 inability to raise bail, did not alone raise equal protection claims.
The equal protection infringement in Byrd was triggered by the imposition of the criminal sentence. It did not mature on the setting of bail and the inability of the defendant to raise bail (See Whitty v. State (1967), 34 Wis.2d 278, 286, 149 N.W.2d 557) or at the completion of preconviction confinement. Byrd recognized that pretrial detention was nothing less than punishment in that it deprived the defendant of his liberty. But it was only when that punishment was added to further punishment in the form of a penal sentence, that the equal protection claim arose. And even then, the equal protection claim could only be heard when the total confinement would exceed the statutory maximum.
In the instant case, the triggering aspect, i.e., the imposition of a criminal sentence never occurred. There was no subsequent punishment to which preconviction detention could be added.
Byrd requires that in order for preconviction confinement to be credited to a subsequent sentence, the preconviction confinement, added to the subsequent sentence must exceed the maximum statutorily allowable sentence. Otherwise, there is no equal protection claim.
Commitment under sec. 975.06, Stats., is commitment for an indefinite period of time. The purpose of the Sex Crimes Act is to protect society from dangerous sex crimes and to provide treatment for the dangerous sex offenders. A completely indeterminate sentence is necessary to accomplish those objectives. Hill, supra, p. 927. Sections 975.11 through 975.14 so provide, conditioning the defendant's eventual release upon his recovery from his physical or mental aberrations and upon a finding that he no longer presents a danger to society.
Sec. 975.13, Stats., provides that if upon the expiration of the term, as designated in sec. 975.12 (1), the department *690 is of the opinion that discharge of a person would still be dangerous to the public because of that person's mental or physical deficiency, disorder or abnormality, the department shall direct that he remain subject to its control. The department is then required to apply to the committing court for a review of that order. After full hearing on the issue of danger to the public, as provided for in sec. 975.14 (1), the committing court must either confirm the order of the department, or order the discharge of the person. If confirmed, the person will be validly in the custody of the department for another five years, at which point a new review is required. Such orders and applications may be repeated as often as in the opinion of the department it may be necessary for the protection of the public. Sec. 975.15 (1).
The statutory structure above described clearly contemplates an indefinite commitment, the length of which is to be determined solely by the defendant's own recovery and the cessation of his status as a danger to the public.
The defendant contends that sec. 975.12 (1), Stats., in effect, mandates a commitment equivalent to the maximum criminal sentence. It accomplishes no such feat. Under sec. 975.11, a person committed is to be discharged as soon as, in the department's opinion, there is reasonable probability that he can be given full liberty without danger to the public. Under our holding in State ex rel. Terry v. Schubert (1976), 74 Wis.2d 487, 247 N.W.2d 109, the due process rights there accorded to the defendant during the periodic examinations under sec. 975.09, ensure a periodic redetermination of the defendant's status and ensure his early release if he is no longer in need of treatment and a danger to the public. Thus, the defendant could be released prior to the expiration of the sec. 975.12(1) term. Likewise, under the provisions of secs. 975.11 and 975.13 through 975.15, defendant could remain *691 committed for a much longer, even indefinite, term. What is mandated by the provisions of sec. 975.12(1) is the requirement of holding a de novo judicial hearing to determine whether the defendant's release would still constitute a danger to the public. In the sec. 975.14, Stats., hearing the defendant is accorded the full range of judicial due process.
Although sec. 975.12 (1), Stats., dictates when that procedural review is to take place, that section is not determinative of the length of the commitment.
There being no statutory maximum time of incarceration in a sec. 975.06, Stats., commitment, and there being imposed here an indefinite commitment, Byrd cannot apply. The legislature has made a legislative determination that certain sex deviates are in need of a particularized kind of treatment. It has not decided that all persons convicted of those sex crimes defined in sec. 975.01 are to receive the specialized treatment but only those determined to need such treatment after appropriate examinations and hearings. As to those persons so determined to need such specialized treatment, the legislature has determined that such persons shall be committed to the department subject to review, release and discharge under the procedure established by the legislature.
Our inquiry should not be directed so as to inhibit such a classification in a troublesome area, but only to whether the distinction furthers some legitimate, articulated purpose. We believe that the sex crime law does articulate such a purpose. It is not for us to pass judgment on the success or failure of the state program to treat those persons in need of specialized treatment because of their mental and physical aberrations. McGinnis v. Royster (1973), 410 U.S. 263, 93 Sup. Ct. 1055, 35 L. Ed.2d 282.
McGinnis v. Royster, supra, was an entitlement case. The challenge there was to the distinction between county jails which served primarily as detention centers and *692 the state prisons where a rehabilitative program existed. The McGinnis court held that there was a legitimate legislative aim in the classifications and that, ". . . legislative solutions must be respected if the `distinctions drawn have some basis in practical experience,' . . ." at page 276.
In McGinnis v. Royster, supra, pp. 276, 277, it was stated:
". . . Legislation is frequently multipurposed: the removal of even a `subordinate' purpose may shift altogether the consensus of legislative judgment supporting the statute. Permitting nullification of statutory classifications based rationally on a nonprimary legislative purpose would allow courts to peruse legislative proceedings for subtle emphases supporting subjective impressions and preferences. The Equal Protection Clause does not countenance such speculative probing into the purposes of coordinate branch. . . ."
The defendant further suggests that the early release of a person committed under sec. 975.06, Stats., by virtue of a determination that he is no longer dangerous to the public must be likened to the early release of a criminally sentenced prisoner. Here too, the defendant would analogize a sex deviate commitment to a criminal sentence and directs our attention to a number of federal cases. All the federal cases relate to issues arising out of the imposition of penal sentences, and we deem no useful purpose would be served by citing them and discussing them.
The defendant also contends that even if his confinement may be extended beyond the term as provided in sec. 975.12 (1), Stats., and may be indefinite, credit for precommitment custody could still be of considerable value to him by accelerating the date for a 975.14 hearing.[3]
*693 The records of the department reflect that the defendant was in fact released from CSH on December 1, 1975. Therefore, this issue would only become viable if the department found it necessary to return the defendant to CSH and if the defendant was still at CSH on his release date under sec. 975.12, Stats.
[3] However, commitment pursuant to the Sex Crimes Act is for all practical purposes a commitment for an indefinite period. Under these circumstances we hold that the concepts of equal protection require that the defendant be credited with 67 days preconviction detention time which resulted from his inability to raise bail. Such credit would serve to accelerate the date on which the defendant is entitled to a full judicial hearing pursuant to secs. 975.12 through 975.14, Stats., concerning his status, in the event that he is still in custody.
Finally, the defendant argues that commitment under the Sex Crimes Act denies him equal protection in that he is not entitled to the same reductions in confinement as a defendant sentenced penally for the same crime. This court's decision in Mitchell, supra, as stated at p. 706, specifically rejected such an argument.
The defendant's contention that the failure to credit preconviction detention in this case violates the equal protection clause of the fourteenth amendment is without merit. Likewise his contention that double jeopardy principles have been violated can have no merit.

PRECOMMITMENT DETENTION FOR PURPOSES OF PRESENTENCE EXAMINATION.
On October 21, 1970, based upon a conviction of two counts of indecent behavior with a minor contrary to sec. 944.11, Stats., the trial court ordered the defendant *694 committed to the department for a period of not to exceed sixty days for the purposes of obtaining a presentence social, physical and mental examination as mandates by sec. 975.01 and 975.04. The defendant was returned to the trial court on December 11, 1970, having spent a total of fifty-one days confinement at CSH.
The defendant contends that a failure to credit the above postconviction, precommitment confinement constitutes a fifth amendment double jeopardy violation, and in support of this argument relies on cases from federal jurisdictions in which penal sentences were imposed.[4]
[4] We conclude that the constitutional provision relating to double jeopardy has no applicability to the instant case. This is so because as we have stated, the defendant did not receive a sentence. The double jeopardy clause protects against multiple punishments for the same offense. North Carolina v. Pearce, supra, p. 717, fn 11. There was no penal sentence, and hence no punishment imposed in this instance. What the defendant received was a commitment which had for its dual purpose, his treatment and the protection of society. In Mitchell, supra, it was stated that the purpose of the presentence examination was not penal in nature but ". . . a means of determining whether sentence should be imposed at all." Mitchell, supra, p. 701.
*695 [5] The fact that no penal sentence was here involved, coupled with the rejection by this court of the double jeopardy argument in the preconviction confinement Byrd Case and the rejection of the double jeopardy argument in the postconviction confinement in State v. Wills (1975), 69 Wis.2d 489, 230 N.W.2d 827, dictate a rejection of the defendant's double jeopardy argument here.
On December 11, 1970, the defendant requested a Huebner-type hearing to contest the department's recommendation that he be given specialized treatment as a sex deviate. The trial court set the hearing for January 8, 1971. The defendant remained in county jail between December 11, 1970, and January 8, 1971, a total of twenty-eight days.
The defendant contends that the failure to credit jail detention pending the Huebner-type hearing violates the double jeopardy, equal protection, and due process clauses of the United States Constitution.
The double jeopardy argument, under these circumstances, is without merit. Furthermore, the twenty-eight day period of time, which for the most part was to be used for the parties to prepare their cases and for the court-appointed psychiatrist to make his examination and prepare a report, is intrinsic to the orderly disposition of the case and it would be difficult to categorize this period of time as additional punishment.
The equal protection argument advanced by the defendant is specifically precluded by this court's decision in Mitchell. Time spent in contesting the results of an examination must be treated the same as a reasonable time spent making the examination; for the process is not complete until all objections and challenges to the examination have been properly dealt with. In any event, twenty-eight days is a reasonable time to prepare for argument on the issue of the findings of the department, and on that ground alone, a violation of the equal protection *696 clause cannot be supported. See Mitchell, supra, pp. 701, 702, and Kubart v. State (1975), 70 Wis.2d 94, 233 N.W.2d 404, cf. State ex rel. Solie v. Schmidt (1976), 73 Wis.2d 76, 242 N.W.2d 244.
The defendant raises the argument that the failure to credit this period of time had the effect of punishing him for exercising his constitutional rights to a Huebner-type hearing in violation of his right to due process. The argument is based upon the premise that the defendant would have avoided that extra twenty-eight day incarceration if he had chosen not to contest the department's recommendations.
The defendant must realize that he only has a right to a Huebner-type hearing when the department recommends specialized treatment. He gets no hearing if the department does not recommend specialized treatment. State v. Schmidt, supra. If he does not contest the recommendations, he can be committed. If the unsuccessfully contests the recommendations, he can likewise be committed. Only if he successfully contests the recommendations, does he suffer the imposition of a penal sentence.
The simple fact is that under these circumstances, there was nothing for the defendant to avoid by choosing not to contest the recommendations. He was not penally sentenced; the twenty-eight day period of confinement was added to no period of incarceration; and his eventual release from commitment was dependent not upon any given passage of time, but upon his recovery from his mental and physical aberrations.
There was no chilling effect on the exercise of protected rights. There was no denial of due process.

PRECOMMITMENT DETENTION CAUSED BY INCOMPETENCY TO PROCEED.
On January 8, 1971, the trial court committed the defendant to CSH for examination pursuant to sec. *697 971.14 (2), Stats., for a sixty day period to determine the defendant's competency to assist his attorney in the sentencing phase of the proceeding against him. On February 23, 1971, the defendant was committed for an indefinite period of time pursuant to sec. 971.14(5) as incompetent to proceed with sentencing. The defendant remained confined at CSH from January 8, 1971, to June 29, 1971, when he appeared before the trial court, waived his Huebner-type hearing and was committed to the department pursuant to sec. 975.06, for specialized treatment as a sex deviate. He was thus confined for a period of 172 days.
The defendant contends that the failure to credit the CSH incompetency observation and commitment detention violates the double jeopardy and due process guarantees of the United States Constitution.
We deem the double jeopardy argument to have been adequately addressed in our consideration of the previous issues. The purpose of commitment under sec. 971.14 (1), Stats., and sec. 971.14 (5), served to determine whether or not the defendant ever would be sentenced. That period cannot be classified as additional punishment. This is particularly so when the defendant was never penally sentenced.
The defendant contends that failure to credit the above time violates due process. The argument is based on the premise that had he not requested a Huebner-type hearing, the issue of his competency never would have arisen and he would never have been committed under the provisions of sec. 971.14 (1), Stats., and sec. 971.14 (5). The defendant further argues that the incompetency incarceration can only be viewed as a punishment added to the commitment because of the defendant's desire to contest the sexual deviancy finding. Defendant likens this due process violation to that previously described as having a chilling effect on the exercise of his rights.
*698 [6] The defendant's basic premises along these lines are totally in error. The defendant was not found incompetent to proceed because he exercised his right to request a Huebner-type hearing. The incompetency findings under secs. 971.14(1) and 971.14 (5), Stats., had no relation to the request for a Huebner-type hearing. The trial judge upon his own observations, among other reasons, found that there was reasonable probability to doubt the defendant's competency. The only possible connection between the incompetency commitments and the Huebner-type hearing was that the incompetency issue arose at the hearing. The defendant would have this court believe that there was a cause and effect relationship between the request for a Huebner-type hearing and the incompetency commitments when in fact no such relationship existed. There was no denial of due process.
The order denying the postconviction motions is amended to provide that the defendant is entitled to have the date of the judicial hearing mandated by secs. 975.12 through 975.14, Stats., advanced 67 days, in the event that he is still in custody at that time.
By the Court.Order modified consistent with this opinion, and in all other respects affirmed.
NOTES
[]  Motion for rehearing denied, without costs, on February 15, 1977.
[1]  Huebner v. State (1967), 33 Wis.2d 505, 147 N.W.2d 646.
[2]  Sections 975.09, 975.11 and 975.13, Stats.
[3]  The defendant cites Bolling v. Manson (D. Conn. 1972), 345 Fed. Supp. 48, and Wilson v. State of North Carolina (4th Cir. 1971), 438 Fed.2d 284, wherein the defendants were serving penal sentences for life and it was held that they were entitled to sentence credit, although it only accelerated their parole eligibility date.
[4]  North Carolina v. Pearce (1969), 395 U.S. 711, 89 Sup. Ct. 2072, 23 L. Ed.2d 656; Pruett v. State of Texas (5th Cir. 1972), 468 Fed.2d 51, 57, affirmed and modified en banc (1973), 470 Fed.2d 1182; Howie v. Byrd (W.D.N.C. 1975), 396 Fed. Supp. 117; Durkin v. Davis (E.D. Va. 1975), 390 Fed. Supp. 249; Taylor v. Gray (E.D. Wis. 1974), 375 Fed. Supp. 790; Parker v. Bounds (E.D.N.C. 1971), 329 Fed. Supp. 1400; Culp v. Bounds (D.C.N.C. 1971), 325 Fed. Supp. 416; Faye v. Gray (7th Cir. 1976), 541 Fed.2d 665. We have also considered Brinkman. v. Schubert; Streeter v. Carballo; Williams v. Gray; and Harris v. Gray, decided by the District Court for Western District of Wisconsin on October 1, 1976.
