The opinion of the court was delivered by: Justice Thomas
 Docket No. 95873-Agenda 13-November 2003.
 Paul Williams, plaintiff in the proceedings below and defendant in the original criminal proceedings, filed a petition for writ of habeas corpus in the circuit court of Cook County pursuant to section 10-124 of the Code of Civil Procedure (735 ILCS 5/10-124 (West 2000)). Williams' petition alleged that he was in the custody of the Department of Human Services (DHS) in Elgin, Illinois, and that his detention was illegal because his maximum period of confinement under section 5-2-4(b) of the Unified Code of Corrections (the Code) (730 ILCS 5/5-2-4(b) (West 2000)) had expired. The circuit court denied Williams' petition for writ of habeas corpus and remanded Williams to the custody of the DHS. The appellate court reversed the circuit court's order and remanded the cause to the circuit court for a determination concerning whether Williams should be civilly committed. 337 Ill. App. 3d 445. This court allowed the State's petition for leave to appeal. See 177 Ill. 2d R. 315(a). For the following reasons, we affirm the decision of the appellate court in part and vacate in part.
 In the original criminal proceedings, Williams was charged with first degree murder for killing and dismembering his sister. At the time of the murder, Williams was abusing narcotics. On December 19, 1982, the trial court found Williams not guilty by reason of insanity. Williams was involuntarily committed to the custody of the Illinois Department of Mental Health and Developmental Disabilities (now the DHS), and was confined to the Elgin Mental Health Center (Elgin). Williams was involuntarily committed pursuant to section 5-2-4(b) of the Code.
 Section 5-2-4(b) provides that the maximum period of time that a defendant can be involuntarily committed cannot exceed the maximum length of time that the defendant would have been required to serve, less credit for good behavior, before becoming eligible for parole had defendant been convicted of and received the maximum sentence for the most serious crime for which he was found not guilty by reason of insanity. See 730 ILCS 5/5-2-4(b) (West 2000), formerly Ill. Rev. Stat. 1981, ch. 38, par. 1005-2-4(b). This maximum length of time is known as the defendant's Thiem date. See People v. Thiem, 82 Ill. App. 3d 956 (1980). In this case, the circuit court originally determined that Williams' maximum period of commitment was 80 years. Based upon subsequent case law, however, the trial court on December 8, 2000, reset Williams' Thiem date to September 26, 2001.
 Also on December 8, 2000, the trial court granted the petition of the Elgin facility director to conditionally release defendant for a period of five years, pursuant to section 5-2-4(d)(2) of the Code (730 ILCS 5/5-2-4(d)(2) (West 2000)), over Williams' objection to the five-year period. Sometime after September 26, 2001, but prior to the expiration of the five-year conditional release period, Williams violated the terms of his conditional release by preliminarily testing positive for cocaine. The State therefore filed a petition to revoke Williams' conditional release. Williams filed a special and limited appearance contesting the circuit court's jurisdiction and seeking to dismiss the State's petition to revoke his conditional release. Thereafter, Williams again tested positive for cocaine. The circuit court then issued a contempt citation and issued a warrant for Williams' arrest. Williams was arrested around four days later.
 At the hearing on the contempt citation, Williams argued that the circuit court lacked jurisdiction over him because his Thiem date had expired. The circuit court held that even though the Thiem date had expired, the conditional release period provided jurisdiction. The circuit court entered a finding that Williams had violated his conditional release and remanded Williams to the custody of the DHS for an evaluation of whether he required involuntary commitment. The circuit court did not enter a finding on the contempt citation. Over Williams' continuing objection to the court's jurisdiction, Williams was evaluated and found to be subject to inpatient treatment, but not to involuntary commitment. *fn1 Williams then filed his petition for writ of habeas corpus.
 As noted, the circuit court denied Williams' petition for writ of habeas corpus. On appeal, Williams claimed that he was entitled to an immediate release because the circuit court could not continue to confine him past September 26, 2001, his Thiem date. 337 Ill. App. 3d at 450. Williams also argued that neither his conditional release nor his alleged violation of the conditional release could extend his maximum period of commitment beyond his Thiem date. 337 Ill. App. 3d at 450. The State, on behalf of Nancy Staples, hospital administrator of the Elgin Mental Health Center, *fn2 responded that once a defendant is conditionally released, the five-year period of conditional release set forth in section 5-2-4(a)(1)(D) of the Code (730 ILCS 5/5-2-4(a)(1)(D) (West 2000)) supercedes the defendant's Thiem date.
 In reversing the circuit court, the appellate court found that the circuit court lost jurisdiction over Williams on September 26, 2001, when his Thiem date expired. 337 Ill. App. 3d at 460. The appellate court examined the legislature history of the statute and concluded that the legislature did not intend for the five-year conditional release period to extend a court's jurisdiction over a not guilty by reason of insanity (NGRI) defendant past his Thiem date. The appellate court held that although an NGRI defendant may be conditionally released prior to his Thiem date, the five-year period of conditional release may be limited by the amount of time remaining on his Thiem date. 337 Ill. App. 3d at 460. Consequently, once an NGRI defendant's "Thiem date has expired, his or her period of conditional release must necessarily expire as well." 337 Ill. App. 3d at 460.
 Before this court, the State argues that the appellate court erred in holding that an NGRI defendant's conditional release automatically terminates on his Thiem date. The State claims that the appellate court ignored the mandate of section 5-2-4(a)(1)(D) of the Code, which states that the trial court "shall" place an NGRI defendant on conditional release for a period of five years. The State contends that because Williams was conditionally released under section 5-2-4(a)(1)(D) prior to his Thiem date, Williams' Thiem date became irrelevant because he was no longer confined. Rather, Williams was now subject to a five-year period of conditional release, with the possibility of one three-year extension. The State compares this conditional release period to the mandatory supervised release period, or parole, imposed upon convicted defendants.
 Williams responds that after the expiration of his Thiem date, he could no longer be confined as an NGRI defendant, but had to be released or committed pursuant to the Mental Health and Developmental Disabilities Code (Mental Health Code) (405 ILCS 5/1-100 et seq. (West 2000)). Williams argues that because the Thiem date is the outside limit for his period of confinement, the conditional release period cannot extend beyond his Thiem date.
 At issue in this case, then, is which portion of section 5-2-4 of the Code controls when an NGRI defendant is conditionally released prior to his Thiem date, but his Thiem date expires prior to the expiration of his conditional release period. Because our analysis of this issue involves the construction of a statute, the issue presents a question of law that we review de novo. In re Estate of Dierkes, 191 Ill. 2d 326, 330 (2000).
 The fundamental rule of statutory construction is to ascertain and give effect to the legislature's intent. Michigan Avenue National Bank v. County of Cook, 191 Ill. 2d 493, 503-04 (2000). This court determines legislative intent by examining the language of the statute, which is "the most reliable indicator of the legislature's objectives in enacting a particular law." Michigan Avenue National Bank, 191 Ill. 2d at 504. All provisions of a statutory enactment are viewed as a whole. People ex rel. Sherman v. Cryns, 203 Ill. 2d 264, 279 (2003). Accordingly, words and phrases must be interpreted in light of other relevant provisions of the statute and must not be construed in isolation. Cryns, 203 Ill. 2d at 279-80. Each word, clause and sentence of a statute must be given reasonable meaning, if possible, and should not be rendered superfluous. Cryns, 203 Ill. 2d at 280. In determining the intent of the legislature, a court may consider not only the language of the statute, but also the reason and necessity for the law, the evils sought to be remedied, and the purpose to be achieved. Cryns, 203 Ill. 2d at 280. "Legislative intent can be ascertained from a consideration of the entire Act, its nature, its object and the consequences that would result from construing it one way or the other." Fumarolo v. Chicago Board of Education, 142 Ill. 2d 54, 96 (1990).
 The relevant provisions of the Code are as follows. Section 5-2-4 (b) provides, in pertinent part:
 "If the Court finds the defendant subject to involuntary admission *** the initial order for admission of a defendant acquitted of a felony by reason of insanity shall be for an indefinite period of time. Such period of commitment shall not exceed the maximum length of time that the defendant would have been required to serve, less credit for good behavior, before becoming eligible for release had he been convicted of and received the maximum ...