
956 A.2d 310 (2008)
The STATE of New Hampshire
v.
Michael DANSEREAU.
No. 2007-552.
Supreme Court of New Hampshire.
Argued: June 26, 2008.
Opinion Issued: August 15, 2008.
*311 Kelly A. Ayotte, attorney general (Nicholas Cort, assistant attorney general, on the brief and orally), for the State.
James T. Brooks, assistant appellate defender, of Concord, on the brief and orally, for the defendant.
DUGGAN, J.
The defendant, Michael Dansereau, appeals a ruling by the Trial Court (McGuire, J.) denying his motion to vacate his convictions and sentences. We hold that the defendant was unlawfully sentenced to an extended term of imprisonment under RSA 651:6, II(a) (2006) and three years probation under RSA 651:2, V(a) (2006). Accordingly, we vacate his sentence and remand for resentencing.
The following relevant facts are undisputed. On March 8, 2006, the defendant, pursuant to an agreement with the State, pleaded guilty to two counts of class A misdemeanor sexual assault. The Trial Court (Conboy, J.) sentenced the defendant in accordance with the plea agreement. On the first count, the defendant received twelve months stand committed. On the second count, the defendant received a consecutive, suspended sentence of two to five years under the extended term of imprisonment statute, RSA 651:6, II(a), with three years probation under RSA 651:2, V(a). This latter sentence was partly based upon the defendant's prior record, which included: (1) a 1983 conviction for which he received a sentence of three to ten years stand committed; (2) a 1989 conviction for which he received a suspended sentence of three and one-half to seven years; and (3) a 1993 conviction for which he received a suspended sentence of one and one-half to three years.
After serving the twelve-month sentence, the defendant was released on probation, during which time he was arrested for violating the conditions of his probation and for failing to register as a sex offender. The defendant subsequently moved to vacate both of his convictions and sentences, arguing that his sentence on the second count was illegal in two respects. First, he asserted that he was not eligible for an extended term of imprisonment because he had previously been sentenced to prison only once, not twice as required by RSA 651:6, II(a). Second, he contended that his three-year probation term violated RSA 651:2, V(a) because that statute authorizes a maximum probation term of only two years. As a result, the defendant claimed that his plea was not knowing, intelligent, and voluntary, and his sentence violated his due process rights under both the State and Federal Constitutions.
After a hearing, the trial court denied the defendant's motion. It ruled that, because the defendant's prior record included two convictions for which he received sentences in excess of one year, he was eligible for an extended term of imprisonment. *312 The court did not address the legality of the three-year probation term.
On appeal, the defendant argues that: (1) the trial court erred in interpreting RSA 651:6, II(a) as allowing a suspended sentence to qualify as a predicate to an extended term of imprisonment; (2) the trial court erred in permitting the three-year probation period to stand; and (3) because his sentence was illegal, we should remand to the trial court for consideration of whether his plea was involuntary. The State concedes that the three-year probation term was illegal, but contends that the extended term of imprisonment was proper under RSA 651:6, II(a). The State also asserts that the correct remedy for any illegality in the defendant's sentence is to amend his sentence, not to allow him to withdraw his plea.

I
We first address the defendant's contention that the extended term of imprisonment was unlawful. Resolution of this issue requires us to interpret RSA 651:6, II(a). We are the final arbiters of the legislative intent as expressed in the words of the statute considered as a whole. State v. Langill, 157 N.H. 77, 84, 945 A.2d 1 (2008). We begin by examining the language of the statute, State v. Whittey, 149 N.H. 463, 467, 821 A.2d 1086 (2003), and ascribe the plain and ordinary meaning to the words used, Langill, 157 N.H. at ___, 945 A.2d 1. We interpret legislative intent from the statute as written and will not consider what the legislature might have said or add language that the legislature did not see fit to include. Id. We also interpret a statute in the context of the overall statutory scheme and not in isolation. Id. If a statute is ambiguous, however, we consider legislative history to aid our analysis. Whittey, 149 N.H. at 467, 821 A.2d 1086. Our goal is to apply statutes in light of the legislature's intent in enacting them, and in light of the policy sought to be advanced by the entire statutory scheme. Id. We construe the Criminal Code provisions "according to the fair import of their terms and to promote justice." RSA 625:3 (2007); see State v. Foss, 148 N.H. 209, 211, 804 A.2d 462 (2002).
RSA 651:6, II(a) provides, in relevant part, that "[a] convicted person may be sentenced to [an extended term of imprisonment] if the court finds . . . that such person . . . [h]as twice previously been convicted in this state, or in another jurisdiction, on sentences in excess of one year." The defendant argues that this language is ambiguous because "a defendant is not normally said to have been `convicted on a sentence.'" The State counters that the plain language of the statute "requires only proof of two convictions, each with a maximum sentence of more than one year." The State reasons that "[t]he phrase `sentences in excess of one year' clearly refers to terms of imprisonment," and that "such a term may be suspended."
The plain language of RSA 651:6, II(a) requires a defendant to have "twice previously been convicted . . . on sentences in excess of one year." (Emphasis added.) We agree with the defendant that, in normal parlance, a person is not "convicted on sentences." Rather, a person is convicted of a crime and then sentenced. Indeed, subsection (b) of RSA 651:6, II requires a defendant to have previously been "convicted of a violation" of a particular statutory provision, or "convicted of . . . any crime" involving certain factual circumstances. Our review of the statutory scheme similarly reveals no other provisions using the terminology "convicted on sentences." Furthermore, a plain reading of the phrase "convicted on sentences" suggests that the sentences must have resulted *313 in convictions, cf. State v. Kiewert, 135 N.H. 338, 349, 605 A.2d 1031 (1992)a construction completely contrary to common sense. Accordingly, we agree with the defendant that, on its face, RSA 651:6, II(a) is ambiguous. We therefore review the legislative history to discern the intent behind this statutory language. Whittey, 149 N.H. at 467, 821 A.2d 1086.
Prior to 2003, the statutory scheme allowed a trial court to impose an extended term of imprisonment if the court found one of several factors. See RSA 651:6, I (2002). The factor relevant to this case permitted the trial court to extend the term of imprisonment if it found that the defendant had "twice previously been imprisoned, in this state or in any other jurisdiction, on sentences in excess of one year." RSA 651:6, I(c) (2002) (emphases added). In applying this factor, the trial court needed to "make two findings: (1) two prior imprisonments, resulting from, (2) sentences in excess of one year." State v. Scognamiglio, 150 N.H. 534, 539, 842 A.2d 109 (2004). To meet the imprisonment requirement, the State needed to "establish that the defendant was in fact imprisoned on th[e] sentence"; that is, provide "evidence that the defendant was taken to a correctional facility." Id. at 540, 842 A.2d 109.
In 2003, the legislature altered the language in section I of the statute to provide that a convicted person may receive an extended term of imprisonment if a jury, not a court, finds certain facts beyond a reasonable doubt. Compare RSA 651:6, I (2004) with RSA 651:6, I (2002). The legislature, however, removed subsection (c), which allowed a court to impose an extended term of imprisonment if the court found that the defendant had "twice previously been imprisoned . . . on sentences in excess of one year," RSA 651:6, I(c) (2002), from section I, and, after replacing the word "imprisoned" with "convicted," moved the subsection to a new section II. Compare RSA 651:6, II(a) (2004) with RSA 651:6, I(c) (2002). Section II, in turn, allows a court to impose an extended term of imprisonment if the court, not a jury, finds certain facts, and includes those findings in the record. Thus, RSA 651:6, II(a) now provides that a court may impose an extended term of imprisonment if the court finds that the defendant "has twice previously been convicted . . . on sentences in excess of one year."
The rationale underlying this change in language and structure is found in the legislative record. In 2003, at the request of the State Attorney General's Office, Representative William V. Knowles introduced House Bill (HB) 277, which, among other things, amended RSA 651:6, I, in the manner described above. Senate Judiciary Comm., Hr'g on H.B. 277 1-2 (April 1, 2003); see also N.H.S. Jour. 646 (2003); N.H.H.R. Jour. 273 (2003). The stated purpose behind the amendments at issue was to bring RSA 651:6 into compliance with the United States Supreme Court's decision in Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000). See N.H.S. Jour. 646 (2003); N.H.H.R. Jour. 273 (2003). In that case, the Supreme Court held that "[o]ther than the fact of a prior conviction, any fact that increases the penalty for a crime beyond the prescribed statutory maximum must be submitted to a jury, and proved beyond a reasonable doubt." Apprendi, 530 U.S. at 490, 120 S.Ct. 2348. As discussed above, under former RSA 651:6, I, the court, not a jury, was responsible for finding the facts that would warrant an extended term of imprisonment.
At a hearing on HB 277 before the Senate Committee on the Judiciary, Representative Knowles, as well as a representative from the State's Attorney General's *314 Office, discussed the reason for the amendments. Senate Comm. On Judiciary, Hr'g on H.B. 277 1-2 (April 1, 2003). The testimony provides, in relevant part:
The U.S. Supreme Court said [in Apprendi] that any factors to support an extended term other than prior convictions need to be found by a jury. The court can consider the prior conviction. So, what we did was separate out this statute into factors that the jury needed to find beyond a reasonable doubt and ones that the court could find by itself. Section 1 . . . of the bill provides that a convicted person may be sentenced to an extended term if the jury also finds beyond a reasonable doubt and then it lists a number of factors. Section 2 . . . talks about when the court can impose an extended term if the court makes a particular finding. The ones in Section 2 under prior conviction. The ones within Section 1 are all of the other factors that, according to the United States Supreme Court, now need to be found by a jury. It doesn't change the substance of the bill in any respect. The sentences are the same, . . . it just simply makes clear whether it be the jury or the judge that meets the factors to support an extended term.

Senate Comm. On Judiciary, Hr'g on H.B. 277 3 (April 1, 2003) (emphases added).
Relying upon the foregoing history, the defendant argues "that the legislature did not intend to expand the extended term statute to apply to suspended sentences." He interprets the legislative history as demonstrating that the legislature amended former RSA 651:6, I(c) "not to affect [sic] a sea change in the sentencing law, but merely to ensure compliance with Apprendi" and "to ensure the provision's constitutionality." The defendant reasons that "[b]y removing the requirement that the State prove actual imprisonment, the legislature tried to make certain that a judge could find that a defendant had twice previously received non-suspended sentences in excess of one year without considering evidence falling outside the prior conviction exception." Thus, "[u]nder the new provision, a judge can simply refer to the same mittimus he used to find the prior conviction's existence to determine whether the sentence was stand-committed or suspended."
The State counters that "[i]f the legislature had intended to retain the requirement of actual imprisonment, it would simply have done what it did with the other. . . provisions in [section] I"; that is, "retained the same language, but made the requirement subject to proof beyond a reasonable doubt before a jury." The State interprets the legislature's failure to take this action coupled with its act of "insert[ing] the provision into [section] II with different language" as demonstrating a legislative "inten[t] to alter the meaning of the provision, in order to ensure that it described a fact that could be found by a sentencing court under Apprendi, namely `the fact of a prior conviction.'"
We read the legislative history as establishing that the legislature's intent in amending former RSA 651:6 was solely to comply with Apprendi. Compliance with Apprendi required the legislature to ensure that any fact, other than the fact of a prior conviction, that warranted an extended term of imprisonment be found by a jury beyond a reasonable doubt. Apprendi, 530 U.S. at 490, 120 S.Ct. 2348. The changes in the language and structure of former RSA 651:6 imply that the legislature effectively determined that imprisonment constituted a fact other than a prior conviction that would need to be submitted to a jury. Thus, the legislature changed "imprisoned" to "convicted" in an effort to be consistent with Apprendi.
*315 The legislature did not provide any further indication of what types of convictions it was referring to when it used the phrase "convicted on sentences in excess of one year." RSA 651:6, II(a). The legislative history, however, suggests that the legislature did not intend to substantively change the prior statutory scheme. See N.H.S. Jour. 646 (2003); N.H.H.R. Jour. 273 (2003). The testimony from the Senate Committee hearing states that the amendments did not "change the substance of the bill in any respect." Senate Comm. On Judiciary, Hr'g on H.B. 277 3 (April 1, 2003). Rather, the legislature intended to "simply make[] clear whether it be the jury or the judge that meets the factors to support an extended term." Id. Read in context, this testimony implies that the legislature did not intend to broaden the scope of RSA 651:6, but, instead, intended to merely designate which factors need to be submitted to the jury and which ones the court could find. Accordingly, the legislative history supports a conclusion that the phrase "convicted on sentences in excess of one year" does not include the defendant's suspended sentences. See Scognamiglio, 150 N.H. at 539, 842 A.2d 109.
We acknowledge that the legislative history is not entirely on point; it neither expressly addresses suspended sentences nor clearly indicates what types of convictions the legislature intended to include within the phrase "convicted on sentences in excess of one year." Any remaining doubt as to the legislature's intent, however, must be resolved in favor of the defendant. See State v. MacLeod, 141 N.H. 427, 434, 685 A.2d 473 (1996); State v. Morey, 103 N.H. 529, 530, 176 A.2d 328 (1961).
We have previously noted that "[t]he rule of lenity serves as a guide for interpreting criminal statutes where the legislature failed to articulate its intent unambiguously." MacLeod, 141 N.H. at 434, 685 A.2d 473 (citation omitted). This rule of statutory construction "generally holds that ambiguity in a criminal statute should be resolved against an interpretation which would increase the penalties or punishments imposed on a defendant." Id. (citations omitted). It is "rooted in `the instinctive distaste against men languishing in prison unless the lawmaker has clearly said they should.'" United States v. R.L.C., 503 U.S. 291, 305, 112 S.Ct. 1329, 117 L.Ed.2d 559 (1992) (plurality opinion) (quoting United States v. Bass, 404 U.S. 336, 348, 92 S.Ct. 515, 30 L.Ed.2d 488 (1971)). By applying the rule of lenity, we "reject[ ] the impulse to speculate regarding a dubious [legislative] intent," and avoid "play[ing] the part of a mind reader." United States v. Santos, ___ U.S. ___, ___, 128 S.Ct. 2020, 2026, 170 L.Ed.2d 912 (2008) (plurality opinion).
Although the parties have not discussed the rule of lenity in their briefs, the rule is a well-established tool of statutory construction. See, e.g., Bass, 404 U.S. at 347-48, 92 S.Ct. 515; United States v. Kozeny, 493 F.Supp.2d 693, 700-01 (S.D.N.Y.2007). In this case, as discussed above, neither the language nor the legislative history of RSA 651:6, II(a) clearly establish what the legislature intended by the phrase "convicted on sentences in excess of one year." Thus, we apply the rule of lenity and resolve the ambiguity in favor of the defendant. The portion of the defendant's sentence imposing an extended term of imprisonment under RSA 651:6, II(a) was therefore unlawful.

II
The parties agree that the defendant's three-year probationary term was illegal. Thus, in light of our finding that the defendant's extended term of imprisonment was also unlawful, the defendant's *316 entire sentence on the second count must be vacated. The defendant argues, however, that we must also provide him the opportunity to vacate his guilty plea and convictions.
"A guilty plea must be knowing, intelligent, and voluntary to be valid." State v. Offen, 156 N.H. 435, 437, 938 A.2d 879 (2007) (quotation omitted). Thus, a defendant must voluntarily waive his rights and "fully understand[] the elements of the offense to which he is pleading, the direct consequences of the plea, and the rights he is forfeiting." State v. Lopez, 156 N.H. 193, 200, 931 A.2d 1186 (2007) (citations omitted).
The defendant urges us to hold that, when a sentence is illegal, a guilty plea is involuntary because the defendant has not been informed of the direct consequences of his plea, and, thus, the plea must be vacated. We acknowledge that in other jurisdictions, "[w]here the defendant has entered a guilty plea pursuant to a plea bargain contemplating a particular sentence, the general rule is that the defendant is entitled to withdraw the plea if it is subsequently determined that the sentence is illegal or unauthorized." Annotation, Guilty Plea as Affected by Fact that Sentence Contemplated by Plea Bargain is Subsequently Determined to be Illegal or Unauthorized, 87 A.L.R.4th 384, 388 (1991 & Supp.2008). Many courts, however, have limited the application of this general rule depending upon the factual circumstances of a particular case. Id. at 388. We have never adopted this general rule, and, because the factual circumstances presented in this case do not warrant application of that rule, we decline to do so.
In this case, at the time of his plea, the defendant voluntarily negotiated and agreed to a sentence that was greater than that permitted by law. On remand, assuming no other extended term provision is applicable, he should necessarily receive a reduced sentence. Thus, the defendant may still receive a sentence that provides him with the full benefit of his plea bargain. See, e.g., People v. Sheils, 288 A.D.2d 504, 732 N.Y.S.2d 269 (2001). In these circumstances, we cannot conclude that the defendant needs to be provided with an opportunity to withdraw his plea, as the illegal sentence may be corrected on resentencing in a manner that gives the defendant the benefit of his bargain. See Annotation, supra, 87 A.L.R.4th at 400-03. Accordingly, we vacate the defendant's sentence on the second count and remand to the trial court for resentencing consistent with this opinion.
Sentence vacated and remanded.
BRODERICK, C.J., and DALIANIS, GALWAY and HICKS, JJ., concurred.
