
840 N.E.2d 281 (2005)
362 Ill. App.3d 99
298 Ill.Dec. 511
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
John BURKE, Defendant-Appellant.
No. 2-03-1127.
Appellate Court of Illinois, Second District.
July 25, 2005.
Rehearing Denied December 12, 2005.
*282 G. Joseph Weller, Deputy Defender, and Bruce Kirkham (Court-appointed), Office of the State Appellate Defender Elgin, for John Burke.
Joseph E. Birkett, Du Page County State's Attorney, Wheaton, Martin P. Moltz, Deputy Director, Barry W. Jacobs, State's Attorneys Appellate Prosecutor, Elgin, for the People.
Presiding Justice O'MALLEY delivered the opinion of the court:
Defendant, John Burke, appeals his conviction of armed robbery in violation of section 18-2(a)(1) of the Criminal Code of 1961 (Criminal Code) (720 ILCS 5/18-2(a)(1) (West 2000)). Defendant argues that the State did not prove all elements of the offense beyond a reasonable doubt. Defendant also argues that the trial court wrongly interpreted the Habitual Criminal Act (720 ILCS 5/33B-1 et seq. (West 2000)) as applying to him. We affirm.
Section 18-1 of the Criminal Code (720 ILCS 5/18-1 (West 2000)) defines the offense of robbery as follows: "A person commits robbery when he or she takes property * * * from the person or presence of another by the use of force or by threatening the imminent use of force." The offense of armed robbery is defined in sections 18-2(a)(1) and (a)(2) of the Criminal Code (720 ILCS 5/18-2(a)(1), (a)(2) (West 2000)):
"(a) A person commits armed robbery when he or she violates Section 18-1; and
(1) he or she carries on or about his or her person or is otherwise armed with a dangerous weapon other than a firearm; or
(2) he or she carries on or about his or her person or is otherwise armed with a firearm[.]"
*283 Armed robbery in violation of either of these subsections is a Class X felony, but a violation of subsection (a)(2) requires that 15 years of imprisonment be added to the term imposed by the court. (720 ILCS 5/18-2(b) (West 2000)).
Defendant was charged by indictment with two counts of armed robbery. The first count alleged that "defendant, while armed with a dangerous weapon, a gun, knowingly took property, being a purse and contents from the presence of Kathleen Jordan by use of force," in violation of section 18-2(a)(1). The second count alleged that "defendant, while armed with a firearm, knowingly took property being a purse and contents from the presence of Kathleen Jordan, by the use of force," in violation of section 18-2(a)(2).
During its case in chief, the State moved to nol-pros the second count and proceed on the first count alone. The trial court granted the motion. The evidence showed that defendant seized Kathleen Jordan's purse from her while he was brandishing a firearm. The jury returned a verdict of guilty. At sentencing, the trial court determined that a sentence of life imprisonment was mandatory in light of defendant's two prior convictions of armed robbery.
Defendant's first contention on appeal is that the State failed to prove him guilty of armed robbery as alleged in the first count, which was based on subsection (a)(1) of section 18-2. Subsection (a)(1) requires the robbery to have been committed with a "dangerous weapon other than a firearm" (720 ILCS 5/18-2(a)(1) (West 2000)). Defendant asserts that the State's proof did not satisfy these elements, for the only weapon of which there was any evidence at trial was a firearm.
Defendant urges that the issue here is whether the State's proof met the elements of subsection (a)(1) of section 18-2. Clearly, the State's proof did not satisfy these elements. From our review of the record, however, it is apparent that the State intended the jury to decide whether defendant violated subsection (a)(2), not subsection (a)(1), of section 18-2. In our assessment, the issue is whether the indictment, which, after the State amended it during trial, mistakenly cited subsection (a)(1), sufficiently apprised defendant of the elements of subsection (a)(2).
As noted above, the State charged defendant under subsection (a)(1) in count I of the indictment and under subsection (a)(2) in count II. The State alleged in both counts that defendant had a firearm during the robbery, even though subsection (a)(1) specifically excludes instances where firearms were used. Thus, either the State misapprehended the elements of subsection (a)(1) or it inadvertently included the firearm allegation in count I. Whatever the case, the proof at trial showed that defendant brandished a firearm during the robbery. There was no proof of any other weapon. Shortly before the conclusion of its case in chief, after all evidence about the nature of the weapon was already admitted, the State made a motion to nol-pros the second count. The assistant State's Attorney explained: "We'd [sic] have a motion to nolle-pros [sic] Count 2, which is the firearm count of the indictment, since all the instructions I drafted relate to the dangerous weapon."[1] Notably, the assistant State's Attorney did not say that the dismissal of count I was based on insufficient proof that defendant used a firearm during the robbery. Indeed, *284 the proof at trial that defendant brandished a firearm was overwhelming and uncontested. We can only conclude that the State's failure to dismiss count I rather than count II, or at least to amend count I to cite subsection (a)(2) instead of subsection (a)(1), cannot reasonably be attributed to any perception by the State that proof of a firearm was lacking. Rather, the State apparently misapprehended the elements of subsection (a)(1), believing that it could satisfy those elements with proof that defendant had a firearm.
The question for us to decide is whether defendant was prejudiced by the State's mistake of submitting count I rather than count II to the jury, or at least of failing to amend count I to cite subsection (a)(2). Defendant made no challenge to the indictment at trial. "Where a defendant challenges the sufficiency of an indictment or information for the first time on appeal, a reviewing court need only determine whether the charging instrument apprised the defendant of the precise offense charged with enough specificity to prepare his or her defense and allow pleading a resulting conviction as a bar to future prosecution arising out of the same conduct." People v. Maggette, 195 Ill.2d 336, 347-48, 254 Ill.Dec. 299, 747 N.E.2d 339 (2001). In making this determination, the reviewing court may resort to the record. Maggette, 195 Ill.2d at 348, 254 Ill.Dec. 299, 747 N.E.2d 339.
Defendant could not reasonably believe that, at the time count II was dismissed, the State intended to prove that he committed the robbery with a dangerous weapon other than a firearm. Count I contained all the elements of subsection (a)(2) of section 18-2 though it cited subsection (a)(1). "Where the language of the indictment sufficiently informs a defendant of the charges against him, and defendant cannot demonstrate any prejudice from an incorrect statutory citation, the defect is formal and does not warrant reversal." People v. Witt, 227 Ill.App.3d 936, 944, 169 Ill.Dec. 915, 592 N.E.2d 402 (1992). See also People v. Melton, 282 Ill.App.3d 408, 415, 217 Ill.Dec. 795, 667 N.E.2d 1371 (1996) ("Although the statute cited in the charging documents was no longer in effect, the criminal offense of child endangerment was still embodied in the Criminal Code. Accordingly, defendants' claim that they were convicted of a nonexistent crime is without merit"). Defendant does not attempt to show that he was prejudiced by the State's failure to submit to the jury a count that cited subsection (a)(2) of section 18-2 rather than subsection (a)(1). We can discern no prejudice ourselves and therefore reject defendant's argument.
Defendant's second argument is that the trial court misconstrued the Habitual Criminal Act (Act) in finding him subject to a mandatory term of life imprisonment based on his prior convictions of armed robbery. This issue was not raised in the trial court. However, the plain error doctrine permits review of illegal or impermissible sentences. People v. Voit, 355 Ill.App.3d 1015, 1027, 292 Ill.Dec. 17, 825 N.E.2d 273 (2004). Therefore, we reach defendant's argument.
Section 33B-1(a) of the Act (720 ILCS 5/33B-1(a) (West 2000)) provides:
"Every person who has been twice convicted * * * of an offense that contains the same elements as an offense now classified in Illinois as a Class X felony * * *, and is thereafter convicted of a Class X felony * * * committed after the 2 prior convictions, shall be adjudged an habitual criminal."
Section 33B-1(d) of the Act provides:
"This Article shall not apply unless each of the following requirements are [sic] satisfied:

*285 (1) the third offense was committed after the effective date of this Act;
(2) the third offense was committed within 20 years of the date that judgment was entered on the first conviction, provided, however, that time spent in custody shall not be counted;
(3) the third offense was committed after conviction on the second offense;
(4) the second offense was committed after conviction on the first offense." 720 ILCS 5/33B-1(d) (West 2000).
"Except when the death penalty is imposed, anyone adjudged an habitual criminal shall be sentenced to life imprisonment." 720 ILCS 5/33B-1(e) (West 2000).
The record shows that defendant was convicted of armed robbery on July 31, 1978, and was released on parole on March 15, 1979. Defendant was again convicted of armed robbery on September 22, 1980, and was released on parole on January 20, 1995. Defendant committed the current offense on September 29, 2001, after the effective date of the Habitual Criminal Act. Armed robbery had the same elements in 1978 and 1980 as it did in 2001. Twenty-three years and three months elapsed between defendant's first conviction and the date of the current offense. However, defendant spent approximately 10 months in prison on the first conviction and approximately 15 years in prison on the second conviction. Interpreting section 33B-1(d) as requiring that the periods in custody on both the first and second convictions be excluded from the computation, the trial court held that defendant committed the current armed robbery within 20 years of the first conviction. Accordingly, the trial court sentenced defendant to life imprisonment.
In defendant's view, section 33B-1(d)(2) (720 ILCS 5/33B-1(d)(2) (West 2000)) provides only that time spent in custody on a defendant's first conviction should be excluded from the computation. Section 33B-1(d)(2) requires that the "third offense" be committed "within 20 years of the date that judgment was entered on the first conviction, provided, however, that time spent in custody shall not be counted." (Emphasis added.) Defendant marshals in his cause the last-antecedent rule, which requires that "relative or qualifying words, phrases, or clauses are to be applied to the words immediately preceding, and do not modify words, phrases, or clauses which are more remote." People v. Storms, 254 Ill.App.3d 139, 141, 193 Ill.Dec. 291, 626 N.E.2d 324 (1993). Defendant concludes that the proviso requiring exclusion of time spent in custody applies to the immediate preceding term "first conviction" and not to the term "second offense," which appears elsewhere in section 33B-1(d). We agree with the parties that, if defendant's interpretation is correct, and the 15 years he spent in prison for his second offense are not excluded from the computation, the trial court erred in holding that defendant was subject to mandatory life imprisonment.[2]
This issue is a matter of first impression in this district. Presented with this issue in People v. Abdullah, 336 Ill.App.3d 940, 271 Ill.Dec. 669, 785 N.E.2d 863 (2002), the Fourth District Appellate Court rejected the interpretation advanced here by defendant. The court reasoned:
"If the legislature intended subsection (d)(2) to be interpreted the way defendant interprets it, the legislature could have easily said: `Time in custody for the first offense shall not be counted.' *286 Defendant reads into the statute a limitation that is not in the text of the statute. `When the language of a statute is plain and unambiguous, courts may not read in exceptions, limitations, or other conditions.' In re D.D., 196 Ill.2d 405, 419, 256 Ill.Dec. 870, 752 N.E.2d 1112, 1120 (2001)." (Emphasis omitted.) Abdullah, 336 Ill.App.3d at 953, 271 Ill.Dec. 669, 785 N.E.2d 863.
We agree with the court in Abdullah. The exclusion of time spent in custody is unequivocal and categorical. Where the text of the statute is clear and unambiguous, there is no need to resort to canons of statutory construction such as the last-antecedent rule. People v. Wittenmyer, 151 Ill.2d 175, 195, 176 Ill.Dec. 37, 601 N.E.2d 735 (1992). We recognize, of course, that we are construing a penal statute, and that such provisions must be strictly construed in favor of the accused, with nothing taken by intendment or implication beyond the obvious or literal meaning of the statute. People v. Laubscher, 183 Ill.2d 330, 337, 233 Ill.Dec. 639, 701 N.E.2d 489 (1998). We are in perfect accord with this rule; it is defendant who wishes to insert a limitation into the statute that its text does not allow. Therefore, we conclude that the trial court did not err in excluding from its computation defendant's period of imprisonment for his second conviction of armed robbery and in sentencing defendant to life imprisonment as a habitual offender.
For the foregoing reasons, we affirm the judgment of the circuit court of Du Page County.
Affirmed.
BYRNE and GILLERAN JOHNSON, JJ., concur.
NOTES
[1]  The jury instructions tracked the language of subsection (a)(1) but did not mention the exception for firearms. Defendant does not challenge the adequacy of the jury instructions.
[2]  Defendant also spent an undetermined amount of time on parole, which is considered "custody" under section 33B-1(d) of the Act. People v. Abdullah, 336 Ill.App.3d 940, 955, 271 Ill.Dec. 669, 785 N.E.2d 863 (2003). Whatever the length of defendant's parole, it would have no material effect on the computation.
