
167 Wis.2d 491 (1992)
481 N.W.2d 633
STATE of Wisconsin, Plaintiff-Appellant,
v.
Sonya MOORE, Defendant-Respondent-Petitioner.
Nos. 90-0522-CR, 90-0523-CR.
Supreme Court of Wisconsin.
Oral argument January 3, 1992.
Decided April 9, 1992.
*493 For the defendant-respondent-petitioner there were briefs and oral argument by Margaret A. Maroney, assistant state public defender.
For the plaintiff-appellant the cause was argued by Paul Lundsten, assistant attorney general, with whom on the brief was James E. Doyle, attorney general.
Amicus curiae brief was filed by Walter J. Dickey and Michele M. Lavigne, Madison for Legal Assistance to Institutionalized Persons Program.
HEFFERNAN, CHIEF JUSTICE.
This is a review of published court of appeals decision, 161 Wis. 2d 104, 467 N.W.2d 201 (Ct. App. 1991), which reversed a February 12, 1990 order of the circuit court for Racine county, Dennis J. Barry, Circuit Judge, releasing Sonya Moore (Moore) from the custody of the Winnebago Mental Health Institute (Winnebago) pursuant to sec. 971.14(5)(a), Stats.,[1] because she had been confined for a *494 period of time equal to her potential maximum sentence less "good time credit." [2] We reverse the court of appeals.
In August, 1989, Moore was charged with battery, a Class A misdemeanor punishable by a maximum sentence of nine months, and disorderly conduct, a Class B misdemeanor punishable by a maximum sentence of 90 days. At her arraignment, Moore's counsel questioned Moore's competency to stand trial, and Moore was committed to Winnebago for a competency evaluation pursuant to sec. 971.14(2), Stats. On September 5, 1989, the circuit court reviewed the evaluation and held that Moore lacked competency to proceed but was likely to become competent with proper treatment. The circuit court ordered Moore committed to the custody of the Department of Health and Social Services under sec. 971.14(5)(a).
On February 9, 1990, Moore requested the circuit court to release her from commitment because she had been confined for six months and 23 days, the maximum period of confinement for a person sentenced to the maximum nine month sentence for battery, taking into account good time credit. Moore argued that she was entitled to good time credit under sec. 971.14(5)(a), Stats. The circuit court agreed, concluding that because days spent in confinement under sec. 971.14(5)(a), are *495 deemed days spent in custody under sec. 973.155, Stats., and sec. 973.155(4), Stats.,[3] provides for earned good time, persons committed under sec. 971.14(5)(a), are entitled to good time credit. The circuit court ordered Moore released from commitment and remanded to the custody of the Racine county sheriff, and ordered the corporation counsel to begin involuntary civil commitment proceedings under ch. 51, Stats.
The court of appeals reversed the circuit court's order. The court of appeals concluded that sec. 973.155, Stats., applies only to "convicted offenders," that the length of confinement when a person is committed is controlled solely by the first sentence of sec. 971.14(5)(a), Stats., and that the term "maximum sentence" refers to the maximum sentence allowable for an offense without respect to good time credit.[4] We reverse the court of appeals.
[1-5]
The controlling question on this review is whether a person committed pursuant to sec. 971.14(5)(a), Stats., as incompetent to stand trial is eligible for good time credit. This requires us to construe sec. 971.14(5)(a). The interpretation and construction of a statute presents a question of law to be reviewed without deference *496 to the lower courts. State v. Eichman, 155 Wis. 2d 552, 560, 455 N.W.2d 143 (1990). The primary purpose of statutory interpretation and construction is to ascertain and give effect to the intent of the legislature. Green Bay Redevelopment Authority v. Bee Frank, Inc., 120 Wis. 2d 402, 409, 355 N.W.2d 240 (1984). Where the language of the statute is ambiguous or unclear, the court must ascertain the legislative intent from the statute's context, subject matter, history, and the object intended to be accomplished. Id. Additionally, the court in construing a statute must interpret it in such a way as to avoid an absurd or unreasonable result. Id.
Section 971.14(5) (a), Stats., provides:
If the court determines that the defendant is not competent but is likely to become competent within the period specified in this paragraph if provided with appropriate treatment, it shall suspend the proceedings and commit the defendant to the custody of the department for placement in an appropriate institution for a period of time not to exceed 18 months, or the maximum sentence specified for the most serious offense with which the defendant is charged, whichever is less. Days spent in confinement under this paragraph shall be deemed days spent in custody under s. 973.155.
Ambiguity exists where a statute is capable of being understood by reasonably well-informed persons in two or more different senses. State v. Derenne, 102 Wis. 2d 38, 45, 306 N.W.2d 12 (1981). Moore argues that ambiguity is evidenced by the fact that the trial court and the court of appeals interpreted sec. 971.14(5)(a), Stats., differently. The state argues that the phrase "maximum sentence" plainly and unambiguously refers to the maximum sentence allowed by statute for a given offense. Misdemeanor battery, the most serious offense with *497 which Moore was charged, carries a maximum sentence of nine months. Sections 940.19(1) and 939.51(3)(a), Stats.[5]
[6, 7]
We conclude that reasonably well-informed persons could interpret sec. 971.14(5)(a), Stats., in two different senses.[6] One reasonable interpretation is that advanced by the statethe term "maximum sentence" means the maximum allowable sentence for the offense charged. This however ignores the second sentence of the statute, which refers to sec. 973.155, Stats., the sentence credit statute. The court must consider the entire subsection to determine whether it is ambiguous. Another reasonable interpretation is that advanced by the circuit courtthat because days spent in commitment under sec. 971.14(5)(a), are deemed days spent in custody under sec. 973.155, and because sec. 973.155(4), provides for earned good time, persons committed under sec. 971.14(5)(a), are entitled to earned good time. Because both interpretations are reasonable, sec. 971.14(5)(a), is ambiguous.
*498 Because the language of the statute is ambiguous regarding whether committed persons are entitled to good time, we must examine extrinsic matters such as the statute's context, subject matter, history and the object to be accomplished to ascertain the intent of the legislature. Green Bay Redevelopment Authority, 120 Wis. 2d at 409. Where possible, we will interpret a statute to avoid an absurd or unreasonable result. Id. In this case, we conclude that the object to be accomplished by sec. 971.14(5)(a), Stats., is to provide treatment to an incompetent person so that he or she may regain competency and face the pending criminal charges. The commitment is in no way punitive, for there has been no determination of guilt. In light of this purpose, we conclude that the legislature did not intend the absurd result that the state may confine an incompetent person awaiting trial, who has neither been convicted of a crime nor found committable pursuant to ch. 51, Stats., longer than it could confine a competent person either convicted or found not guilty by reason of mental disease or defect of the same offense.
Individuals convicted of a battery and sentenced to the maximum nine month sentence will be released from jail in six months and 23 days pursuant to sec. 53.43, Stats., unless they violate certain jail rules and regulations.[7] Individuals found not guilty of a battery by reason *499 of mental disease or defect must be released from commitment in six months and 23 days, pursuant to sec. 971.17(4), Stats.[8] Individuals committed as incompetent to stand trial on a battery charge, under the state's interpretation of sec. 971.14(5)(a), Stats., may be confined for the full nine months before they must be released.
Nevertheless the possibility exists that a convicted person could spend more than the six months and 23 days in jail. However, the state admits in its brief that "it is undeniably true that most defendants convicted of *500 misdemeanors are released early, in part because of the availability of `good time.' "Under sec. 971.17, Stats., a person committed as not guilty by reason of mental disease or defect cannot forfeit good time.
It is absurd that a person not competent to stand trial on a battery charge, and who is "still clothed with a presumption of innocence," McGinnis v. Royster, 410 U.S. 263, 273 (1973), can be confined longer than a person convicted of the same offense, or committed longer than a person found not guilty by reason of mental disease or defect of the same offense. We conclude that the legislature did not intend this result.
A review of the legislative history of sec. 971.14(5)(a), Stats., suggests that the inclusion or exclusion of good time for committed persons was neither considered nor addressed by the legislature. Rather, the history of the statute reflects a continuing good faith effort by the legislature to respond to decisions of both this court and the United States Supreme Court regarding the constitutional limitations upon the state's ability to commit an individual found to be incompetent to stand trial.
The earliest statutory provisions regarding commitment of persons incompetent to stand trial provided for indefinite commitment. Chapter 191, sec. 4700, Stats. In 1969, the legislature revised the criminal laws of Wisconsin, and abandoned the indefinite commitment of persons incompetent to stand trial. Section 971.14(5)(a), Stats., 1969 provided in part:
When the maximum period for which the defendant could have been imprisoned if convicted of the offense charged has elapsed, the court shall dismiss the case and shall order the defendant to be discharged subject to the right of the department to proceed against the defendant under ch. 51.
*501 Thus the legislature apparently conclude that persons committed as incompetent to stand trial should be confined no longer than they could be if convicted.
In Jackson v. Indiana, 406 U.S. 715 (1972), the United States Supreme Court considered the constitutional limits of a state's ability to commit a person found incompetent to stand trial:
[A] person charged by a State with a criminal offense who is committed solely on account of his incapacity to proceed to trial cannot be held more than the reasonable period of time necessary to determine whether there is a substantial probability that he will attain that capacity in the foreseeable future. If it is determined that this is not the case, then the State must either institute the customary civil commitment proceeding that would be required to commit indefinitely any other citizen, or release the defendant.
Id. at 738. Subsequent decisions of this court interpreted that "reasonable period of time" to be six months, State ex rel. Matalik v. Schubert, 57 Wis. 2d 315, 328, 204 N.W.2d 13 (1973), and eighteen months, State ex rel. Haskins v. Dodge County Court, 62 Wis. 2d 250, 262, 214 N.W.2d 575 (1974). In 1975, the legislature amended sec. 971.14(5), Stats., in response to these decisions. Chapter 153, Laws of 1975. The legislature removed the reference to the "maximum period for which the defendant could have been imprisoned" and simply limited the maximum period of commitment to 24 months.
In State ex rel. Deisinger v. Treffert, 85 Wis. 2d 257, 270 N.W.2d 402 (1978), this court held that sec. 971.14(5), Stats., as amended in 1975, violated the due process guarantees accorded civil committees. We stated that the legislature had misconstrued Haskins, and stressed the language of Haskins that "`the maximum *502 period of confinement under sec. 971.14(5) should comport as nearly as possible with the maximum term of confinement . . ..'" Id. at 267, citing Haskins, 62 Wis. 2d at 261. To save the constitutionality of the statute, the court read into it a requirement "that one found incompetent to stand trial is entitled to release when observatory confinement reaches the length of the potential maximum sentence for the underlying criminal offense." Id. at 268. The question of whether the "potential maximum sentence" included good time credit was not considered.
Shortly after Deisinger was decided, the legislature amended sec. 971.14(5)(a), Stats., to its current form. Chapter 367, Laws of 1981. The state asserts that the adoption of the phrase "maximum sentence" from Deisinger evidences the legislature's intent that persons committed as incompetent to stand trial are not entitled to good time credit. We disagree. Nothing in Matalik, Haskins or Deisinger can be read to imply that a person committed as incompetent to stand trial should be confined longer than he or she would be confined if convicted of or found not guilty by reason of mental disease or defect of an offense. Rather, as expressly stated in Haskins, confinement under sec. 971.14(5)(a), should comport as nearly as possible with the maximum terms of confinement for the offense charged, which includes good time credit.
[8]
In light of the non-punitive nature of commitment under sec. 971.14(5)(a), Stats., and the fact that good time credit applies to persons found guilty or not guilty by reason of mental disease or defect of an offense, it would be incongruous to deny good time credit to persons found incompetent to stand trial. The legislative history of sec. 971.14(5)(a), does not indicate that the *503 legislature intended this result. We hold that the legislature intended by reference to sec. 973.155, Stats., that good time credit be accorded persons committed as incompetent to stand trial under sec. 971.14(5)(a).
By the Court.The decision of the court of appeals is reversed.
NOTES
[1]  Section 971.14(5)(a), Stats., 1987-88 provides:

If the court determines that the defendant is not competent but is likely to become competent within the period specified in this paragraph if provided with appropriate treatment, it shall suspend the proceedings and commit the defendant to the custody of the department for placement in an appropriate institution for a period of time not to exceed 18 months, or the maximum sentence specified for the most serious offense with which the defendant is charged, whichever is less. Days spent in confinement under this paragraph shall be deemed days spent in custody under s. 973.155.
This section was repealed and recreated by sec. 2850, 1989 Wis. Act 31, effective January 1, 1990. The only substantive change was to reduce the maximum time of confinement from 18 months to 12 months. Because Moore's competency proceedings began on August 7, 1989, all statutory references in this opinion are to the 1987-88 statutes.
[2]  The term "good time credit" refers to county jail sentences. Section 53.43, Stats., 1987-88 (renumbered as sec. 302.43, Stats., (1989-90). With respect to prison sentences, the statutes refer to a prisoner's "mandatory release date." Section 53.11, Stats., 1987-88 (renumbered as sec. 302.11, Stats., 1989-90). Under both concepts, the incarcerated individual must be released upon serving a portion of his or her sentence, unless the release date is extended for disciplinary reasons.
[3]  Section 973.155(4), Stats., provides:

The credit provided in sub. (1) shall include earned good time for those inmates subject to s. 53.43, 56.07(3) or 56.19(3) serving sentences of one year or less and confined in a county jail, house of correction or county reforestation camp.
[4]  The court of appeals also rejected Moore's argument that sec. 971.14(5)(a), Stats., as interpreted by the state violates both due process and equal protection guarantees. Because we conclude on statutory grounds that sec. 971.14(5)(a), Stats., includes good time credit, we do not reach Moore's constitutional challenges. State v. Hamilton, 120 Wis. 2d 532, 540, 356 N.W.2d 169 (1984).
[5]  Moore was also charge as a habitual offender under sec. 939.62, Stats. Pursuant to sec. 939.62(1)(a), Stats., Moore's potential sentence for a conviction on the battery charge could have been increased from nine months to three years. The state, however, does not argue that a penalty enhancer statute such as sec. 939.62, Stats., factors into the determination of the "maximum sentence" under sec. 971.14(5)(a), Stats.
[6]  While we conclude that the statute is ambiguous, we do not agree that different interpretations by different courts render a statute ambiguous. Under this reasoning, a trial court's finding of ambiguity is final, because a contrary conclusion by an appellate court would itself evidence ambiguity. That is, the appellate court's conclusion that the statute is unambiguous would create an ambiguity. This "test" is unworkable.
[7]  Section 53.43, Stats., 1987-88 (renumbered as sec. 302.43, Stats.) provides:

Every inmate of a county jail is eligible to earn good time in the amount of one-fourth of his or her term for good behavior if sentenced to at least 4 days, but fractions of a day shall be ignored. An inmate shall be given credit for time served prior to sentencing under s. 973.155, including good time under s. 973.155(4). An inmate who violates any law or any regulation of the jail, or neglects or refuses to perform any duty lawfully required of him or her, may be deprived by the sheriff of good time under this section, except that the sheriff shall not deprive the inmate of more than 2 days good time for any one offense without the approval of the court.
Section 53.11, Stats., 1987-88 (renumbered as sec. 302.11, Stats.) establishes a "mandatory release date" for prison inmates at twothirds of the sentence, with similar provisions by which violations of prison rules and regulations subject an inmate to extension of the mandatory release date.
[8]  Section 971.17(4), Stats., provides:

When the maximum period for which a defendant could have been imprisoned if convicted of the offense charged has elapsed, subject to s. 53.11 and the credit provisions of s. 973.155, the court shall order the defendant discharged subject to the right of the department to proceed against the defendant under ch. 51. If the department does not so proceed, the court may order such proceeding.
The state asserts that this subsection provides good time only to persons charged with felonies, because it does not refer to sec. 53.43, the good time provision for persons serving jail sentences. However, it does refer to sec. 973.155, Stats., and as discussed above, sec. 973.155(4), Stats., specifically provides for earned good time for persons serving jail sentences. Moreover, we reject as absurd a construction of this subsection which would apply good time to persons committed as not guilty by reason of mental disease or defect of a felony and deny good time credit to persons committed as not guilty by reason of mental disease or defect of a misdemeanor.
