
242 Cal.App.2d 488 (1966)
In re THOMAS JOHN KERNAN on Habeas Corpus.
Crim. No. 4033. 
California Court of Appeals. Third Dist.  
May 25, 1966.
 Colley & McGhee and Milton McGhee for Petitioner.
 Thomas C. Lynch, Attorney General, Doris H. Maier, Assistant Attorney General, John L. Giordano and Edward A. Hinz, Jr., Deputy Attorneys General, for Respondent.
 PIERCE, P. J.
 This petition for habeas corpus by a releasee at large under an involuntary commitment of a person not charged with a crime under Welfare and Institutions Code section 3100  [fn. 1] (formerly, and when petitioner was committed, Pen. Code,  6500) seeks discharge upon several grounds. We discuss one of them only because we have determined that he is entitled to be released thereunder, namely, he is a person committed "as a result of such person's having requested the district attorney to file a petition for his commitment" under said section 3100 and therefore has been under restraint beyond the period permitted under that portion of Welfare and Institutions Code section 3201 (formerly Pen. Code,  6521) which reads as follows: "Any other provision of this chapter notwithstanding, in any case in which a person was committed pursuant to Article 3 as a result of such person's *490 having requested the district attorney to file a petition for his commitment, such person must be discharged no later than two years and six months after his commitment."
 [1] If that provision were to be interpreted literally, petitioner would not qualify: his father was the person who requested the district attorney to file the petition. We have before us, however, authenticated copies of all documents pertaining to the commitment. From them it is clear that although the father was nominally the applicant, petitioner and his attorney from the outset cooperated so completely with the district attorney and the court as to demonstrate that commitment under the terms of the section was voluntary, i.e., effectually the act of petitioner himself.  [fn. 2]
 The facts disclosed are these: On April 23, 1962, petitioner's father filed a petition alleging that his son Thomas (petitioner) had upon a number of occasions acquired and used Dilaudid, a narcotic drug as defined in the Health and Safety Code; that because of this he was a narcotic addict or in danger of becoming one within the meaning of section 6500 of the Penal Code (now Welf. & Inst. Code,  3100). Physicians appointed to examine petitioner filed reports in which both diagnosed petitioner as being not yet an addict but a person imminently in danger of becoming one. Letters from petitioner's attorneys, Schaber and Cecchettini, to Deputy District Attorney Reagor make it clear that petitioner, a college and a law school student, fully aware of his problem, was ready and willing to take advantage of the rehabilitation program offered by the state, and that if he had not been the titular applicant of the proceedings, it was a family affair in which he was fully cooperative.  [fn. 3]
 That portion of section 3201 which we have quoted above (formerly Pen. Code,  6521) was added by Statutes 1963, *491 chapter 1706. Before that amendment no preferential treatment in the matter of obtaining a discharge existed in favor of the person voluntarily submitting to involuntary confinement (and to the other rehabilitating features of the program) over those resisting treatment. [2] The purpose of the Legislature in adding the provision for a limited period of restriction is obvious. It was to induce and encourage noncriminal narcotic addicts and persons in danger of becoming addicts to take advantage of the benefits of the program voluntarily.
 " 'The statute must be construed with reference to the purpose intended by the law-making body. When the true intention of the legislature is ascertained it must be given effect. ...' " (Stigall v. City of Taft, 58 Cal.2d 565, 571 [25 Cal.Rptr. 441, 375 P.2d 289].) [3] Where two interpretations are possible that interpretation will be adopted which leads to the more reasonable result. (Metropolitan Water Dist. v. Adams, 32 Cal.2d 620, 630-631 [197 P.2d 543].) [4] A mere literal interpretation will not prevail over that which accords with the obvious purpose of the legislation. (Hidden Valley Municipal Water Dist. v. Calleguas Municipal Water Dist., 197 Cal.App.2d 411, 420 [17 Cal.Rptr. 416].)
 [5] Applying those rules in aid of statutory interpretation, we hold that the language of the amendment is broad enough to permit it to be interpreted to include as a person who has requested the district attorney to file the petition, etc., one who--as is the case here--has effectually so acted.
 [6] The Attorney General argues that to apply the 1963 amendment to this petitioner is to give the amendment retroactive effect.  [fn. 4] We do not consider that in granting this petition the amendment is being applied retroactively. The 1963 amendment provides that a person voluntarily submitting to the program "must be discharged no later than two years and six months after his commitment." (Italics supplied.) The judgment of commitment made here was "for a period of five (5) years except as earlier discharge is provided for by *492 law." That order was made May 17, 1962. The 1963 amendment became effective on September 20, 1963. When petitioner had served two years and six months (i.e., on November 17, 1964) that fact and not the date of the judgment established his right. By the express terms of the statute he was entitled to his discharge. The law is not being applied retroactively; it is being applied prospectively.
 Let the writ issue for petitioner's immediate discharge.
 Friedman, J., and Regan, J., concurred.
NOTES
[fn. 1]  1. Section 3100 of the Welfare and Institutions Code reads as follows: "Anyone who believes that a person is addicted to the use of narcotics or by reason of the repeated use of narcotics is in imminent danger of becoming addicted to their use or any person who believes himself to be addicted or about to become addicted may report such belief to the district attorney, under oath, who may, when there is probable cause, petition the superior court for a commitment of such person to the Director of Corrections for confinement in the narcotic detention, treatment and rehabilitation facility."
[fn. 2]  2. It is to be noted that at the time when the petition in this matter was filed, April 23, 1962, the Kernan family and the attorneys involved would have had no reason for petitioner himself to request the district attorney to file the petition. The provision of section 3201 which we have quoted was not then part of the law.
[fn. 3]  3. A letter from Mr. Schaber of that firm to Mr. Reagor, dated May 15, 1962, includes the following: "When I wrote my letter of yesterday I overlooked the fact that the statute under which we are proceeding in this case does not permit out patient treatment, unless it is authorized after commitment to the adult authority .... Therefore, it is obvious that both of the physicians feel that Mr. Kernan is in imminent danger of becoming addicted, and I assume that we can only act to have him committed to the adult authority, which is the more preferable treatment." (Italics supplied.) A copy of this letter was sent to the court. The minute order of the judgment of commitment, dated May 17, 1962, shows that at the hearing a representative of this firm of attorneys was present, and that no objection to the commitment was raised. The formal judgment contains the following recital: "And the said Thomas John Kernan in open court both personally and through his counsel having waived formal hearing and having submitted the matter to the court for decision based upon the reports of the doctors aforesaid ...."
[fn. 4]  4. When in 1963 the Legislature amended the pertinent sections as set forth in Statutes 1963, chapter 1706, it stated (in  17 of the amending act): "Nothing in this act shall be deemed to impair the legality or effectiveness of any order made or other action taken that was lawful when taken."
