¶ 63. 0dissenting). Chapter 980 is an involuntary commitment statute. It permits the State to confine a person indefinitely not as punishment for what that person has done, but rather based on the person's mental state and what that person might do in the future.
¶ 64. Since its inception, Chapter 980 has survived multiple constitutional challenges because commitment under that chapter rests on an assessment of the person's current mental state. A person can be committed under Chapter 980 if there is a showing that the person is dangerous because of a mental disorder that makes it likely that the person will engage in future acts of sexual violence.
¶ 65. The majority undermines this bedrock principle of Chapter 980. It appears to hold that there need not be any finding that a person is mentally ill or dangerous at the time the person is actually committed to an institution for treatment. Instead, it permits an involuntary commitment to act like a detainer that can be executed "at any time" after the findings of mental illness and dangerousness are made. Under the majority's analysis, these findings could have been made months or even years before the person is actually committed to the custody of the Department of Health Services (DHS) for treatment.
¶ 66. Because the majority's interpretation cannot be squared with the constitution, the statute, or the legislative history, I respectfully dissent.
I
¶ 67. Allowing an involuntary commitment order to be entered "at any time" unconstitutionally divorces the findings of mental illness and dangerousness from *115the time the commitment is actually "executed." I have previously observed that repeated legislative amendments which made the statute increasingly punitive threatened the constitutionality of involuntary commitments under Chapter 980. State v. Rachel, 2002 WI 81, 254 Wis. 2d 215, 647 N.W.2d 762 (Bradley, J., concurring). Here, it is not the legislature but rather, it is the majority opinion of this court that further compromises the constitutionality of the statute.
¶ 68. The majority determines that the commitment orders in this case are valid based upon its conclusion that a circuit court is permitted to "enter a commitment order . . . well before the sexually violent person [is] released from DOC [Department of Corrections] incarceration." Majority op., ¶ 39.
¶ 69. To reach this conclusion, the majority asserts that the language of the commitment statute "does not set a time period for execution of a commitment order," id., ¶ 28, and does not explicitly state "when [a] commitment must commence," id., ¶ 35. Because the legislature removed a provision of the statute requiring the State to allege in the petition that the person is within 90 days of discharge or release from DOC custody, id., ¶ 36, the majority concludes that the legislature intended to permit the State to file a petition "at any time after the person has been convicted of a sexually violent offense," id., ¶ 38.
¶ 70. Tagged on to the end of the opinion, after already arriving at the holding in this case, the majority states: "We will comment briefly on the Petitioners' [constitutional] arguments for the sake of clarity." Id., ¶ 55. It appears to conclude that there is no constitutional infirmity here because Chapter 980, in its various iterations, has withstood constitutional challenges in the past. Id., ¶ 60.
*116¶ 71. Ultimately, the majority reemploys its statutory analysis in lieu of any constitutional analysis. It relies on the fact that the person is mentally ill and dangerous at the time the commitment order is entered in an attempt to salvage its constitutionality — even if the order is not actually executed (meaning the person is not actually committed to DHS custody) until years or even decades later. Id., ¶ 58.
II
¶ 72. The majority's interpretation authorizes an unconstitutional result. If the majority were correct that the statute allowed a commitment order to be entered "at any time after the person has been convicted of a sexually violent offense," this conclusion would singlehandedly undermine the constitutionality of Chapter 980. Just last year, we acknowledged that Chapter 980 "required the State to prove the individual's mental disorder and dangerousness ... at the time of commitment." State v. West, 2011 WI 83, ¶ 95, 336 Wis. 2d 578, 800 N.W.2d 929 (emphasis added). This requirement is necessary to avoid violations of due process, ex post facto, and double jeopardy.
¶ 73. Substantive due process requires that an involuntary commitment is based on a person's current mental illness and dangerousness. Foucha v. Louisiana, 504 U.S. 71 (1992); State v. Post, 197 Wis. 2d 279, 294, 541 N.W.2d 115 (1995). In Foucha, the United States Supreme Court explained that a person could be involuntarily committed "as long as he is both mentally ill and dangerous, but no longer." 504 U.S. at 77. It held: "[K]eeping Foucha against his will in a mental institution is improper absent a determination in civil commitment proceedings of current mental illness and dangerousness." Id. at 78 (emphasis added).
*117¶ 74. Similarly, to resolve a substantive due process challenge in Post, we relied on the fact that "Chapter 980 authorizes the civil commitment of persons, previously convicted of a sexually violent offense, who currently suffer from a mental disorder that predisposes them to repeat such acts." 197 Wis. 2d at 294. "[T]he focal point of commitment is not on past acts but on current diagnosis of a present disorder," which is "conceptualized as a clinically significant behavioral or psychological syndrome or pattern that. . . must reflect a current state of distress." Id. at 307, 306. (emphasis added).
¶ 75. Additionally, both the United States Supreme Court and this court have explained that the focus on the person's current mental state may be necessary to protect an involuntary commitment statute from violating the constitutional prohibition against ex post facto laws. In Kansas v. Hendricks, the Court held that a commitment scheme similar to Chapter 980 does not raise ex post facto concerns because it "permits involuntary confinement based upon a determination that the person currently both suffers from a 'mental abnormality' or 'personality disorder' and is likely to pose a future danger to the public." 521 U.S. 346, 371 (1997) (emphasis in original).
¶ 76. Likewise, in State v. Carpenter, 197 Wis. 2d 252, 274, 541 N.W.2d 105 (1995), this court explained that Chapter 980 survived an ex post facto challenge because "[t]he legislative aim is not punishment but regulation of a present situation." The Carpenter court's determination relied on Chapter 980's focus on "the offender's current mental condition and the present danger to the public, not punishment." Id.
¶ 77. For similar reasons, both the Hendricks Court and the Carpenter court have explained that the *118focus on a person's mental state protects an involuntary commitment statute from violating the constitutional prohibition against double jeopardy. See Hendricks, 521 U.S. at 363 ("[T]he confinement's duration is . . . linked to the stated purposes of the commitment, namely, to hold the person until his mental abnormality no longer causes him to be a threat to others."); Carpenter, 197 Wis. 2d at 268 ("[T]he person is entitled to discharge as soon as his or her dangerousness or mental disorder abates."). The crux of this analysis is that an involuntary commitment does not constitute a second punishment for a past offense because it is based on the current condition of the committed person.
¶ 78. The teachings of these cases are clear. To avoid multiple constitutional infirmities, there must be a finding that the person suffers from a mental disorder and that he is dangerous at the time he is committed. These determinations cannot be made months or years in advance of the execution of a commitment.
¶ 79. The majority appears to interpret the statutory text in a manner that purposefully overlooks this bedrock principle. It concludes that an involuntary commitment order can be entered "at any time after the person has been convicted of a sexually violent offense" and then "executed" at a later date. Majority op., ¶¶ 38, 45.
Ill
¶ 80. In addition to being contrary to constitutional principles, the majority's interpretation is difficult to square with the language and expressed legislative intent underlying Chapter 980. In concluding that a circuit court is permitted to enter a commitment order "well before the sexually violent person [is] re*119leased from DOC incarceration," the majority relies on two premises: (A) the fact that the statute does not explicitly provide when a commitment must be executed; and (B) the inferences it derives from 2005 amendments to Chapter 980. When carefully examined, both fall apart.
¶ 81. The first premise falls apart because the majority interprets the statutory provisions in isolation while ignoring the context set forth in surrounding provisions. This approach violates a basic canon of statutory construction. State ex. rel Kalal v. Circuit Court for Dane County, 2004 WI 58, ¶ 46, 271 Wis. 2d 633, 681 N.W.2d 110 ("Context is important to meaning. . . . Therefore, statutory language is interpreted in the context in which it is used; not in isolation but as part of a whole; in relation to the language of surrounding or closely-related statutes . . . .").
¶ 82. The second premise falls apart because the majority makes inferences about legislative intent without even examining the legislative history.1 Had the majority chosen to examine, rather than to guess and infer, it would have discovered that the relevant 2005 amendments to Chapter 980 were meant to clarify and codify State v. Keith, 216 Wis. 2d 61, 573 N.W.2d 888 (Ct. App. 1997) — not to permit a commitment order to be entered "at any time."
*120A
¶ 83. Contrary to the majority's assertions, the language of Chapter 980, when examined in context, contemplates that a person will not remain in DOC custody once a petition for involuntary commitment has been filed. Instead, the person will be transferred to the custody of the DHS. An examination of three separate provisions of Chapter 980 provides this necessary context.
¶ 84. First, the State's decision to file a petition is generally triggered when the DOC sends notice that a person is within 90 days of release or discharge. Wisconsin Stat. § 980.015(2) provides:
If an agency with jurisdiction has control or custody over a person who may meet the criteria for commitment as a sexually violent person, the agency with jurisdiction shall inform each appropriate district attorney and the department of justice regarding the person as soon as possible beginning 90 days prior to the applicable date of. . . the anticipated discharge or release . . . from a sentence of imprisonment or term of confinement in prison that was imposed for a conviction for a sexually violent offense, from a continuous term of incarceration, any part of which was imposed for a sexually violent offense....
(Emphasis added.)
¶ 85. Second, the plain language of Wis. Stat. § 980.04 states that upon the filing of a petition, an incarcerated person will not be subjected to continued incarceration. Instead, the statute provides that upon the filing of a petition, "[i]f the person is serving a sentence of imprisonment, . . . the court shall order that the person be transferred to a detention facility approved by" the DHS. Wis. Stat. § 980.04(1).
*121¶ 86. Third, once a commitment trial has been held and the person has been determined to be sexually violent, "the court shall order the person to be committed to the custody of the [DHS] for control, care and treatment until such time as the person is no longer a sexually violent person." Wis. Stat. § 980.06. The court's order "shall specify that the person be placed in institutional care." Id.
¶ 87. The term "shall" is presumed to be mandatory when it appears in a statute. State v. Kywanda F., 200 Wis. 2d 26, 33, 546 N.W.2d 440 (1996). Nevertheless, the majority appears to conclude that this statutory mandate is ambiguous. Although the statute provides that the court shall order the person be committed to the custody of the DHS, the majority seizes on the fact that the language of the statute "does not set a time period for execution of a commitment order," majority op., ¶ 28, and does not explicitly state "when [a] commitment must commence," id., ¶ 35.
¶ 88. It is true that Wis. Stat. § 980.06 does not explicitly say that the court shall order the person to be "immediately" committed to the custody of the DHS. It is also true that the statute does not say that the court shall order the person to be committed to the custody of the DHS within a certain number of days of the entry of a commitment order.
¶ 89. Nevertheless, the language of the statute is to be read in context — in light of the surrounding sections of Chapter 980, set forth above. It also must be read in light of court decisions about the constitutionality of involuntary commitments generally and Chapter 980 in particular.2
*122¶ 90. When read in this light, any ambiguity about when a commitment must commence fades away. A commitment must commence once the person has been committed as a sexually violent person. To allow a commitment to act as a detainer to be executed at some later date compromises the bedrock principle of a Chapter 980 commitment — that it is based on the current condition of the person who is committed.
B
¶ 91. To bolster its unconstitutional conclusion that the State may file a petition for commitment "at any time after the person has been convicted of a sexually violent offense," the majority compares the previous version of the statute with the version that exists today. It draws inferences about the legislature's intent by isolating two discrete amendments ushered in by 2005 Wis. Act 434 without examining its accompanying legislative history.
¶ 92. The majority points to former Wis. Stat. § 980.02(2)(ag) (2003-04), which provided that a petition for commitment must allege that "[t]he person is within 90 days of discharge or release ... from a sentence that was imposed for a conviction for a sexually violent offense." When the statute was amended in 2005, the legislature repealed that subsection and created subsection 980.02(lm), which reads: "A petition filed under this section shall be filed before the person is released or discharged." 2005 Wis. Act 434, §§ 82, 83.
*123¶ 93. The phrase "[bjefore the person is released or discharged" could be interpreted differently by reasonably well-informed persons. It could be interpreted to mean at any time before the person is released or discharged, as the majority asserts. Or, when read in context with the surrounding statutes, it could be interpreted to mean shortly before the person is released or discharged. See infra., ¶ 83.
¶ 94. The majority does not acknowledge this ambiguity, and it sees no need to examine the relevant legislative history. Instead, it leaps to the conclusion that the legislature plainly intended to "extendü the possible time for the filing of ch. 980 commitment petitions" so that "a circuit court could enter a commitment order under § 980.06 well before the sexually violent person was released from DOC incarceration." Majority op., ¶¶ 38, 39.
¶ 95. The majority's conclusion would represent a dramatic departure from the prior version of the statute, in which the petition could not be filed until the person was within 90 days of release. It would also be a dramatic departure from how Chapter 980 had previously been described in decisions of Wisconsin courts. See, e.g., Keith, 216 Wis. 2d 61. When I review the relevant legislative history, I see no indication that the 2005 amendments intended to usher in such a change.
¶ 96. If the bill was intended to change Chapter 980 as dramatically as the majority asserts, this significant change surely would have been highlighted in the portions of the legislative history that described the bill. It is not.
¶ 97. If the majority's interpretation is correct, then the significant change ushered forth by the 2005 amendment entirely evaded the attention of the Legislative Council staff members who were in charge of *124drafting the bill and the Joint Legislative Council that recommended the measures to the legislature. None of the numerous documents drafted by the Legislative Council or the Joint Legislative Council to explain the "key provisions" of the bill mentions that it changes the law to allow a person to be committed "at any time after the person has been convicted of a sexually violent offense."3 See, e.g., Wisconsin Legislative Council Re*125port to the Legislature, Special Committee on Sexually Violent Persons Commitment (Sept. 9, 2005), available at http://legis.wisconsin.gov/lc/committees/study/2004/ SVPC/files/RL_05_08_svpc.pdf; Memorandum from Ronald Sklansky, Senior Staff Attorney at the Wisconsin Legislative Council, to Members of the Special Committee on Sexually Violent Person Commitments (Sept. 13, 2004), available at http://legis.wisconsin. gov/lc/committees/study/2004/SVPC/index.htm.
¶ 98. The reason for removing Wis. Stat. § 980.02(2)(ag) (2003-04) and creating sub. (lm) is revealed by examining this legislative history. Both changes were part of a larger package of amendments that were enacted to remove the ambiguity in former Wis. Stat. § 980.02(2)(ag) that had been identified by the court of appeals in State v. Keith, 216 Wis. 2d 61.
¶ 99. In Keith, the defendant served consecutive sentences for first-degree sexual assault, second-degree sexual assault, and fourth-degree sexual assault. On the day before he was scheduled to be released, the State filed a Chapter 980 petition for his commitment as a sexually violent person.
¶ 100. Keith asserted that the court lacked jurisdiction to commit him. In support of this argument, he relied on Wis. Stat. § 980.02(2)(ag), which provided that *126a petition must allege that the person was "within 90 days of discharge or release . . . from a sentence that was imposed for a conviction for a sexually violent offense." Because Keith was serving only a sentence for fourth-degree sexual assault at the time of his release, and because that offense does not qualify as a sexually violent offense, Keith argued that the petition must be dismissed.
¶ 101. The court of appeals disagreed. It concluded that the language of sub. (2)(ag) was ambiguous because it failed to address how consecutive sentences should be treated. Id. at 70. Ultimately, it concluded that the petition was timely because Keith's three consecutive sentences should be treated as one continuous sentence for purposes of determining whether the petition had been timely filed under sub. (2)(ag). It stated: "[T]here is absolutely no indication that the legislature intended to predicate ch. 980 proceedings on whether a sexually violent offense was the last sentence ordered in a string of consecutive sentences." Id. at 72.
¶ 102. The legislative history indicates that the legislature's intent in removing sub. (2)(ag) was to remove the ambiguity identified in Keith — not to permit a petition to be filed "well before the sexually violent person [is] released from DOC incarceration." At the same time the legislature removed sub. (2)(ag), it amended the notice statute, Wis. Stat. § 980.015(2)(a), to codify the precise language from Keith and ensure that notice would be sent within 90 days of discharge or release "from a continuous term of incarceration, any part of which was imposed for a sexually violent offense." See 2005 Wis. Act 434, § 75; Keith, 216 Wis. 2d at 71.
¶ 103. That the legislature removed sub. (2)(ag) for the purpose of omitting the ambiguity identified in *127Keith is supported by the documents produced by the Legislative Council and by the testimony considered by the Special Committee on Sexually Violent Persons Commitment. As a memo written by the Legislative Liaison to the Public Defender's Office explains, the amendment to the procedure for commencing a petition "codifies State v. Keith and clarifies the law." Memorandum by Krista Ginger, Wisconsin State Public Defender Legislative Liaison, to Members of the Special Committee on Sexually Violent Person Commitments at 2 (Jan. 31, 2005).
IV
¶ 104. As described above, the majority's conclusion is not motivated by constitutional requirements, the language of the statute, or the relevant legislative history. Rather, the majority's conclusion appears to be motivated by a policy concern.
¶ 105. Instead of constitutional analysis, it substitutes emotional appeal. The majority posits that its interpretation is necessary to prevent sexually dangerous persons from evading commitment and being released into the community. It asserts that "release from custody of an individual still considered dangerous" is incompatible with the goal of protecting the public, majority op., ¶ 31, and that its conclusion is necessary to "allow[] the State to retain control of sexually violent persons rather than releasing them as a result of their own bad behavior," id., ¶ 49.
¶ 106. No one wants sexually violent people who are dangerous to be released into the streets. Likewise, no one wants sexually violent people to avoid being held accountable for their bad behavior. Yet, no one should allow this court to ignore its obligation to examine and *128apply the constitutional requirements. The majority's failure to do so here compromises the constitutionality of Chapter 980.
¶ 107. Accordingly, I respectfully dissent.
¶ 108. I am authorized to state that CHIEF JUSTICE SHIRLEY S. ABRAHAMSQN joins this dissent.The majority takes issue with my consultation of legislative history. It asserts that my analysis "is representative of the precise evil that Kalal was designed to combat." Majority op., ¶ 28 n.11. In Kalal, however, the court recognized that "[ejxtrinsic evidence of legislative intent may become relevant to statutory interpretation in some circumstances," and that one of those circumstances is when statutory language is ambiguous. 271 Wis. 2d 633, ¶¶ 44, 50-51. Another circumstance may be to avoid an unconstitutional interpretation. See id., ¶ 63 n.11 (Abrahamson, C.J., concurring). Both circumstances are present here.
As set forth above, the constitution requires that the State must carry its burden of proving that the person is both *122mentally ill and dangerous. Foucha v. Louisiana, 504 U.S. 71, 80 (1992). This constitutional requirement is codified in Wis. Stat. § 980.01(7), which defines a "sexually violent person," in part, as a person "who is dangerous because he or she suffers from a mental disorder that makes it likely that the person will engage in one or more acts of sexual violence."
The portion of the Joint Legislative Council's Report to the Legislature which discusses the amendments to Wis. Stat. § 980.02, the section of Chapter 980 which addresses commitment petitions, provides:
Commencement of Commitment Proceedings
Under current law, if an agency with jurisdiction (i.e., the agency with the authority or duty to release or discharge the person) has control or custody over a person who may meet the criteria for commitment as an SVg the agency must inform each appropriate district attorney (DA) and DOJ regarding the person as soon as possible beginning three months prior to the applicable date of the following: (1) the anticipated discharge from a sentence, anticipated release on parole or extended supervision, or anticipated release from imprisonment of a person who has been convicted of an SVO; (2) the anticipated release from a secure juvenile facility of a person adjudicated delinquent on the basis of an SVO; or (3) the termination or discharge of a person who has been found not guilty of an SVO by reason of mental disease or defect.
Under the bill, for persons under a sentence, the agency must inform the DA and DOJ regarding the person as soon as possible beginning 90 days before the date of the anticipated discharge or release on parole or extended supervision, or otherwise, from a sentence of imprisonment or term of confinement in person that was imposed for a conviction for an SVO, from a continuous term of incarceration, any part of which was imposed for an SVO, or from a prison placement under the intensive sanctions program, any part of which was imposed for an SVO. ... The DA and DOJ must also be notified of the anticipated release on parole or discharge of a person committed under ch. 975, Stats, (the sex crimes chapter in effect prior to the creation of ch. 980), for an SVO.
*125Filing a Commitment Petition
Under current law, DOJ may file a petition to commit a person as an SVP at the request of the agency with the authority or duty to release or discharge the person. If DOJ does not file a petition, the DA for the county in which the person was convicted, adjudicated delinquent, or found not guilty by reason of insanity or mental disease, defect, or illness, or the county in which the person will reside, may file the petition. The bill specifies that the DA of the county in which the person is in custody may also file the petition; a juvenile court does not have jurisdiction over a petition involving a child; and filing fees are eliminated.