
740 N.E.2d 377 (2000)
317 Ill. App.3d 573
251 Ill.Dec. 296
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
John LATHON, Defendant-Appellant.
No. 1-99-0261.
Appellate Court of Illinois, First District, First Division.
November 6, 2000.
*378 Michael J. Pelletier, Office of the State Appellate Defender, Chicago (Yasemin Eken, of counsel), for Appellant.
Richard A. Devine, Cook County State's Attorney, Chicago (Renee Goldfarb, William D. Carroll, Alan J. Spellberg and Clayton K. Harris III, of counsel), for Appellee.
Justice FROSSARD delivered the opinion of the court:
In Apprendi v. New Jersey, 530 U.S. 466, ___, 120 S.Ct. 2348, 2362-63, 147 L.Ed.2d 435, 455 (2000), the United States Supreme Court articulated the following constitutional rule and held: "Other 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 ___, 120 S.Ct. at 2362-63, 147 L.Ed.2d at 455. The Court in Apprendi concluded that a New Jersey man who fired shots into the home of an African American family was entitled to have a jury decide whether his sentence should be enhanced beyond the ordinary maximum because he acted with a purpose to intimidate based on race.
The question presented in this case is whether under Apprendi the mandatory Class X sentencing provision of section 5-5-3(c)(8) of the Unified Code of Corrections (the Code) (730 ILCS 5/5-5-3(c)(8) (West 1998)) is unconstitutional because this section required the defendant's sentence to be increased based on prior convictions *379 which were not charged in the indictment, not submitted to a jury and not proved beyond a reasonable doubt. Defendant, John Lathon after a bench trial was convicted of attempted residential burglary, a Class 2 felony (720 ILCS 5/8-4(c)(3), 19-3 (West 1998)). Although a Class 2 felony provides for a possible prison sentence from three to seven years (730 ILCS 5/5-8-1(a)(5) (West 1998)), defendant's criminal history included two prior Class 2 felony convictions, thereby making him ineligible for a Class 2 sentence. As a result of the prior convictions, section 5-5-3(c)(8) of the Code required that defendant receive a Class X prison sentence from 6 to 30 years, and the court imposed a 25-year sentence (730 ILCS 5/5-8-1(a)(3) (West 1998)).
On appeal, defendant argues that: (1) the mandatory Class X sentencing enhancement provision based on prior convictions is unconstitutional under Apprendi as it violates due process and jury trial guarantees because the prior convictions were not alleged in the indictment, were not submitted to the jury and were not proved beyond a reasonable doubt; and (2) his sentence is excessive. We affirm and hold that the mandatory Class X sentencing provision of section 5-5-3(c)(8), which requires sentencing enhancement based on prior convictions is constitutional and does not violate defendant's due process rights or jury trial guarantees. 730 ILCS 5/5-5-3(c)(8) (West 1998).

BACKGROUND
Officer Williams testified that on February 6, 1998, in the 700 block of Garfield Avenue in Oak Park he saw the defendant walking back and forth in front of an apartment building and then stoop down out of sight. The apartment had two entrances; one was on the 700 block of Garfield Avenue and the other was on the 900 block of Wesley Avenue. Williams drove to where defendant had been standing and saw defendant crawl into the window of the apartment at 901 Wesley Avenue. According to Williams, defendant's body was about halfway into the window when defendant backed out of the window. Defendant then looked in Officer Williams' direction and walked briskly down Garfield Avenue. Officer Williams caught up with defendant and told him to stop. Officer Williams asked defendant what he was doing in the window and defendant replied, "just walking by." Defendant denied entering the window. Officer Williams went back to the apartment and saw that the screen for the apartment window had been removed and placed on the street. Officer Williams also observed the window open. Defendant was arrested.
Larry Washburn testified that on February 6, 1998, he lived in apartment G at 901 South Wesley. When he returned to his apartment later that day, the screen to his window was missing, the window was broken and he found a note from the police. He went to the police station and identified the screen that had been removed from his window. Washburn testified that he never gave permission to defendant to enter his apartment. Defendant did not testify and no evidence of defendant's criminal history was offered or admitted during trial. Based on this evidence, the trial court found defendant guilty of attempted residential burglary.
Defendant's criminal history spans 30 years. In the 1960s, defendant was convicted of loitering, unauthorized use of a weapon, and theft. In the 1970s, defendant was convicted of attempted burglary, unlawful use of weapons, armed robbery, attempted murder, burglary, and escape. More recently, in December 1985, defendant was convicted of burglary and received a five-year prison sentence. In September 1989, defendant was convicted of residential burglary and theft and received a 10-year prison sentence. Defendant was again convicted, in March 1993, of residential burglary and received another 10-year prison sentence. In mitigation, defendant explained that a serious drug addiction caused his criminal conduct. Although defendant recognized that this was *380 not an excuse for his conduct, he told the court that since his incarceration he had entered a drug treatment program for the first time. Defendant believed that, because of the drug treatment, he could live a law-abiding and responsible life.
After reviewing the defendant's extensive criminal history and the evidence in mitigation, the trial judge stated that he believed that defendant's addiction to drugs had "motivated him and driven him through his criminality throughout his entire young life and now as he gets into midlife." The judge believed that defendant's family background and other community support provided defendant with the opportunity to deal with that addiction. The trial court refused to sentence defendant within the lower end of the Class X sentencing range. The judge acknowledged overcoming a drug addiction was "extremely difficult" and he sympathized with the defendant's inability to do that. But the judge felt it was necessary to protect society from the defendant's "continuing criminality." The court then sentenced defendant to 25 years in prison. There is no question that defendant's sentence was increased as the result of his continuing criminality and prior convictions. The court specifically found:
"The time for leniency has passed. The time for consideration for these other matters is way passed. Now is the time that we have to take the step necessary to insure that our society is kept safe from continuing criminality since you have shown an inability to do it on your own. The Court must step in and take the proper steps. * * * I'm going to sentence you to 25 years in the Illinois Department of Corrections. I'm going to indicate to you that this is a Class X sentencing due to your criminality."
This appeal followed.

I. WAIVER
The State argues that defendant has waived any challenge to the constitutionality of his sentence under section 5-5-3(c)(8). (730 ILCS 5/5-5-3(c)(8) (West 1998)). The defense contends that "failure to apply a newly declared constitutional rule to criminal cases pending on direct review violates basic norms of constitutional adjudication." Griffith v. Kentucky, 479 U.S. 314, 322, 107 S.Ct. 708, 713, 93 L.Ed.2d 649, 658 (1987). Defendant's case was pending on direct review when Apprendi was decided. The Apprendi opinion was issued by the United States Supreme Court the same day the original order in this case was issued and therefore Apprendi was properly raised by defendant in the petition for rehearing. The State responds that Apprendi did not announce a new constitutional rule and contends that the decisions in Jones v. United States, 526 U.S. 227, 119 S.Ct. 1215, 143 L.Ed.2d 311 (1999), and Almendarez-Torres v. United States, 523 U.S. 224, 118 S.Ct. 1219, 140 L.Ed.2d 350 (1998), addressed the same general issue of enhanced penalties based upon facts presented at sentencing. According to the State, the issue and the cases upon which Apprendi was based were available for defendant to raise at his sentencing hearing or in his original brief. We reject this argument. Jones, as well as Almendarez-Torres, was decided as a matter of statutory interpretation of the federal sentencing guidelines. Jones, 526 U.S. at 252 n. 11, 119 S.Ct. at 1228 n. 11, 143 L.Ed.2d at 331 n. 11. Apprendi for the first time specifically applied the principles recognized in Jones and Almendarez-Torres to state prosecutions. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2355-56, 147 L.Ed.2d at 446-47. We decline to find waiver and address the constitutional challenge raised by defendant. The determination of the constitutionality of a statute is a question of law; therefore, our review is de novo. People v. Fisher, 184 Ill.2d 441, 448, 235 Ill.Dec. 454, 705 N.E.2d 67 (1998).

II. MANDATORY CLASS X SENTENCING PROVISION OF SECTION 5-5-3(c)(8) IS CONSTITUTIONAL UNDER APPRENDI

The defendant argues that the mandatory Class X sentencing provision of section *381 5-5-3(c)(8) violates defendant's right to due process and trial by jury because section 5-5-3(c)(8) did not require the State to give notice of its intent to sentence defendant as a Class X offender and it did not require the State to prove to a jury defendant's prior convictions beyond a reasonable doubt. 730 ILCS 5/5-5-3(c)(8) (West 1998); People v. Jameson, 162 Ill.2d 282, 205 Ill.Dec. 90, 642 N.E.2d 1207 (1994). Defendant also attacks the Class X sentencing provision because the State was not required to prove beyond a reasonable doubt that the specific timing, degree, number, and sequence of defendant's prior convictions established his eligibility for a Class X sentence. According to defendant, the holding of Apprendi requires us to find section 5-5-3(c)(8) unconstitutional, vacate defendant's Class X sentence and remand for defendant to be sentenced as a Class 2 offender.
Section 5-5-3(c)(8) states as follows:
"When a defendant, over the age of 21 years, is convicted of a Class 1 or Class 2 felony, after having twice been convicted of any Class 2 or greater Class felonies in Illinois, and such charges are separately brought and tried and arise out of different series of acts, such defendant shall be sentenced as a Class X offender. This paragraph shall not apply unless (1) the first felony was committed after the effective date of this amendatory Act of 1977; and (2) the second felony was committed after conviction on the first; and (3) the third felony was committed after conviction on the second." 730 ILCS 5/5-5-3(c)(8) (West 1998).
To be sentenced under this section, defendant must have received two prior convictions of a Class 2 or greater class felony, and "the commission and conviction dates of the prior felonies must have occurred in the chronological order mandated by the statute." People v. Williams, 149 Ill.2d 467, 473, 174 Ill.Dec. 829, 599 N.E.2d 913 (1992). Although section 5-5-3(c)(8) increases the defendant's sentence, it does not change the classification of the offense with which defendant has been charged and convicted. People v. Jameson, 162 Ill.2d 282, 290, 205 Ill.Dec. 90, 642 N.E.2d 1207 (1994). Therefore, in order to be sentenced under the enhancement provision of section 5-5-3(c)(8), in addition to the current Class 1 or 2 felony conviction, defendant must have been convicted of two prior felonies each involving its own set of facts: first, a Class 2 or greater felony that was committed after the effective date of the amendment to the statute; and second, a Class 2 or greater felony committed after conviction of the first felony. 730 ILCS 5/5-5-3(c)(8) (West 1998).
In Apprendi, defendant fired a handgun into the home of an African-American family that had recently moved into an all-white neighborhood in Vineland, New Jersey. Defendant was indicted for 23 offenses; however, the indictment did not allege that defendant acted with a racial motive and no reference was made to the New Jersey hate crime statute. Defendant pled guilty to two counts of second-degree unlawful possession of a firearm and one count of third-degree unlawful possession of an antipersonnel bomb. Under New Jersey law, a second-degree offense carried a sentencing range of between 5 and 10 years. However, the New Jersey hate crime statute provided for an extended term of imprisonment if the trial judge found by a preponderance of the evidence that the defendant acted with a purpose to intimidate because of race, color, gender, handicap, religion, sexual orientation or ethnicity. As part of the plea agreement, the State reserved the right to request the court to enhance defendant's sentence under New Jersey's hate crime statute, which allowed for a maximum sentence of 20 years. Defendant reserved the right to challenge the constitutionality of this enhancement. The trial court then conducted an evidentiary hearing to determine defendant's purpose for the shooting and concluded, by a preponderance of the *382 evidence, that defendant acted with a purpose to intimidate based on race. This factor was not alleged in the indictment to which defendant pleaded guilty. The trial court applied the hate crime statute and enhanced defendant's sentence on one count of unlawful possession of a firearm from the 10 years maximum to 12 years. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2351-52, 147 L.Ed.2d at 442-43.
The New Jersey appeals court rejected defendant's argument that the due process clause of the United States Constitution required that the finding of bias must be proved to a jury beyond a reasonable doubt and not left to the discretion of a judge applying the lesser preponderance of the evidence standard. The New Jersey appeals court, relying on McMillan v. Pennsylvania, 477 U.S. 79, 106 S.Ct. 2411, 91 L.Ed.2d 67 (1986), affirmed the trial court, noting that the hate crime enhancement factor of racial bias goes to a person's motive and is a sentencing factor, not an essential element of the underlying criminal offense that need be proven beyond a reasonable doubt. A divided New Jersey Supreme Court affirmed. Relying on McMillan, as well as Almendarez-Torres, the New Jersey Supreme Court, while recognizing that the state hate crime statute increased the maximum penalty, undertook a multifactor analysis and held that the enhanced sentencing provision of the hate crime statute was valid. State v. Apprendi, 159 N.J. 7, 731 A.2d 485 (1999).
The issue as framed by the United States Supreme Court in Apprendi was "whether the due process clause of the fourteenth amendment requires that a factual determination authorizing an increase in the maximum prison sentence for an offense from 10 to 20 years be made by a jury on the basis of proof beyond a reasonable doubt." Apprendi, 530 U.S. at ___, 120 S.Ct. at 2351, 147 L.Ed.2d at 446. The Supreme Court found that the New Jersey hate crime statute which allowed the sentencing enhancement factor of racial bias to be determined by a judge by a preponderance of the evidence violated the defendant's fourteenth amendment due process rights. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2355, 147 L.Ed.2d at 446. That procedure was an "unacceptable departure from the jury tradition that is an indispensable part of our criminal justice system," and the racial bias must be proved to a jury beyond a reasonable doubt. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2366, 147 L.Ed.2d at 446.
In reaching this conclusion, the Apprendi Court indicated that its answer to the question whether Apprendi had a constitutional right to have a jury find bias on the basis of proof beyond a reasonable doubt was foreshadowed by its opinion in Jones v. United States, 526 U.S. 227, 119 S.Ct. 1215, 143 L.Ed.2d 311 (1999). In Jones the Court found unconstitutional a federal carjacking statute that provided for an increased sentence of up to 25 years if severe bodily injury resulted from the offense, although carjacking was ordinarily punishable by a sentence of not more than 15 years. The Supreme Court in Jones concluded that the due process clause of the fifth amendment and the notice and jury trial guarantees of the sixth amendment required that the fact of severe bodily injury be charged by indictment, proven beyond a reasonable doubt, and submitted to a jury for its verdict before defendant could be subjected to increased punishment based on severe bodily injury. The Supreme Court also indicated that the fourteenth amendment commanded the same answer in the Apprendi case which involved a state statute. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2354, 147 L.Ed.2d at 446.
Apprendi followed the reasoning of Jones in analyzing the New Jersey hate crime statute that allowed the trial judge, rather than the jury, to determine that if defendant acted with the specific mental state to intimidate based on race then the penalty for the crime would be increased. The Apprendi Court noted that "as a mater of simple justice" procedural safeguards *383 should apply to proving the bias factor which enhanced Apprendi's sentence. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2355, 147 L.Ed.2d at 446-47. The Court indicated this case concerned constitutional protections of surpassing importance: the fourteenth amendment prohibition of any deprivation of liberty without due process of law and the sixth amendment guarantee that the accused has the right to a speedy and public trial, by an impartial jury. U.S. Const., amends XIV, VI. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2355-56, 147 L.Ed.2d at 435. The Court concluded that taken together, these rights entitle a defendant to a jury determination that he is guilty of every element of the crime beyond a reasonable doubt. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2356, 147 L.Ed.2d at 435 citing United States v. Gaudin, 515 U.S. 506, 115 S.Ct. 2310, 132 L.Ed.2d 444 (1995).
The Apprendi Court rejected the argument that because the New Jersey legislature placed its hate crime sentence enhancement provision within the sentencing section of the criminal code the finding of a biased purpose to intimidate is not an essential element of the offense. The Court also recognized that it does not matter whether the biased finding is characterized as an element or a sentencing factor. Such labels do not answer the essential question, specifically, as to what the impact of the required finding is on defendant's punishment. When deciding the question whether to allow a judge to find a fact increasing punishment beyond the maximum statutory range, "* * * the relevant inquiry is one not of form, but of effectdoes the required finding expose the defendant to a greater punishment than that authorized by the jury's guilty verdict?" Apprendi, 530 U.S. at ___, 120 S.Ct. at 2364, 147 L.Ed.2d at 435.
The Apprendi Court noted that it was permissible "for judges to exercise discretion [in sentencing]taking into consideration various factors relating both to offense and offenderin imposing a judgment within the range prescribed by statute." (Emphasis omitted.) Apprendi, 530 U.S. at ___, 120 S.Ct. at 2358, 147 L.Ed.2d at 449. Thus, Apprendi confirmed that judges have discretion in sentencing as long as they stay within the ordinary maximum set by law. However, Apprendi limited that discretion when judges impose a sentence beyond the ordinary statutory maximum and sentence a defendant to a term higher than that allowed by the offense alleged in the indictment. The Court concluded that judges cannot subject a defendant to a higher sentence beyond the ordinary statutory maximum without providing an opportunity for a jury to determine the sentencing enhancement factor. The Court reasoned that if a defendant faces an extended punishment beyond that within the range prescribed by statute when the offense is committed under certain circumstances but not others, "it is obvious that both the loss of liberty and the stigma attaching to the offense are heightened" and therefore "the defendant should notat the moment the State is put to proof of these circumstancesbe deprived of protections that have, until that point, unquestionably attached." Apprendi, 530 U.S. at ___, 120 S.Ct. at 2359, 147 L.Ed.2d at 451. The Court concluded that due process and jury trial guarantees extend to determinations that enhance the length of a defendant's sentence beyond the ordinary maximum. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2360-61, 147 L.Ed.2d at 452-53.
The Apprendi Court then reviewed its decision in Almendarez-Torres v. United States, 523 U.S. 224, 118 S.Ct. 1219, 140 L.Ed.2d 350 (1998), where it had previously found no violation of a defendant's constitutional rights by a federal statute authorizing the trial judge at sentencing to enhance defendant's punishment based on defendant's previous deportation pursuant to an aggravated felony. In Almendarez-Torres, the indictment charged defendant with the federal offense of having been found in the United States after deportation, *384 which carried a maximum sentence of two years. Defendant during his plea hearing admitted he was deported for three aggravated felony convictions. As a result of the prior convictions, the federal statute increased the maximum sentence to 20 years and the prosecution, under that statute, requested an enhanced sentence. The Court in Almendarez-Torres rejected defendant's argument that the higher sentence created a separate crime and that the fact of defendant's prior convictions should have been alleged in the indictment and proven beyond a reasonable doubt. Instead, it continued to uphold the principle that the use of recidivism to increase an offender's sentence goes only to punishment and may be decided after conviction.
The Court in Apprendi, however, also noted that its decision in Almendarez-Torres "turned heavily upon the fact that the additional sentence to which the defendant was subject was `the prior commission of a serious crime.'" Apprendi, 530 U.S. at ___, 120 S.Ct. at 2361, 147 L.Ed.2d at 454, quoting Almendarez-Torres, 523 U.S. at 230, 118 S.Ct. at 1224, 140 L.Ed.2d at 359. Apprendi further indicated that "[b]ecause Almendarez-Torres had admitted the three earlier convictions for aggravated feloniesall of which had been entered pursuant to proceedings with substantial procedural safeguards of their ownno question concerning the right to a jury trial or the standard of proof that would apply to a contested issue of fact was before the Court." (Emphasis omitted.) Apprendi, 530 U.S. at ___, 120 S.Ct. at 2361, 147 L.Ed.2d at 453. Regarding constitutional concerns triggered by sentencing Almendarez-Torres to a term higher than that allowed by the offense alleged in the indictment, the Apprendi Court recognized: "Both the certainty that procedural safeguards attached to any `fact' of prior conviction, and the reality that Almendarez-Torres did not challenge the accuracy of that `fact' in his case, mitigated the due process and Sixth Amendment concerns otherwise implicated in allowing a judge to determine a `fact' increasing punishment beyond the maximum of the statutory range." Apprendi, 530 U.S. at ___, 120 S.Ct. at 2362, 147 L.Ed.2d at 454.
Defendant argues that because Apprendi calls into question whether Almendarez-Torres was correctly decided we should conclude that Apprendi and Jones require prior convictions to be charged, submitted to a jury and proven beyond a reasonable doubt and hold that enhanced sentencing under section 5-5-3(c)(8) violates a defendant's right to trial by jury and due process. The defendant correctly points out that Apprendi indicated that it is arguable that Almendarez-Torres was incorrectly decided; however, what the Court meant is better understood by looking at that comment in context. The Court stated:
"Even though it is arguable that Almendarez-Torres was incorrectly decided, and that a logical application of our reasoning today should apply if the recidivist issue were contested, Apprendi does not contest the decision's validity and we need not revisit it for purposes of our decision today to treat the case as a narrow exception to the general rule we recalled at the outset. Given its unique facts, it surely does not warrant rejection of the otherwise uniform course of decision during the entire history of our jurisprudence.
In sum, our reexamination of our cases in this area, and of the history upon which they rely, confirms the opinion that we expressed in Jones. Other 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. With that exception, we endorse the statement of the rule set forth in the concurring opinions in that case: `[I]t is unconstitutional for a legislature to remove from the jury the assessment of facts that increase the prescribed range *385 of penalties to which a criminal defendant is exposed. It is equally clear that such facts must be established by proof beyond a reasonable doubt.'" Apprendi, 530 U.S. at ___, 120 S.Ct. at 2362-63, 147 L.Ed.2d at 454-55, quoting Jones, 526 U.S. at 252-53, 119 S.Ct. at 1228-29, 143 L.Ed.2d at 332.
This discussion of Almendarez-Torres ends with the Apprendi Court, based on a re-examination of case law and history, confirming the opinion expressed in Jones and recognizing that prior convictions are an exception to the general rule that facts which increase a sentence beyond the statutory maximum must be submitted to a jury and proved beyond a reasonable doubt. Jones, 526 U.S. at 243 n. 6, 119 S.Ct. at 1224 n. 6, 143 L.Ed.2d at 326 n. 6. We note Jones specifically discussed Almendarez-Torres and its determination that an increase in an offender's penalty because of recidivism need not be alleged in the indictment. The Jones Court stated: "The [Almendarez-Torres] Court's repeated emphasis on the distinctive significance of recidivism leaves no question that the Court regarded that fact as potentially distinguishable for constitutional purposes from other facts that might extend the range of possible sentencing." Jones, 526 U.S. at 249, 119 S.Ct. at 1227, 143 L.Ed.2d at 329. The Court in Jones explained one basis for the potential constitutional distinctiveness of prior convictions: "[U]nlike virtually any other consideration used to enlarge the possible penalty for an offense, * * * a prior conviction must itself have been established through procedures satisfying the fair notice, reasonable doubt, and jury trial guarantees." Jones, 526 U.S. at 249, 119 S.Ct. at 1227, 143 L.Ed.2d at 329-30.
The Apprendi Court not only endorsed the recidivism exception, but articulated reasons for the recidivism exception, including the fact that procedural safeguards enhance the validity of any prior conviction, recidivism is not an essential element of the underlying criminal offense and recidivism does not relate to the commission of the underlying offense. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2365-66, 147 L.Ed.2d at 457-58. These same reasons support applying the recidivism exception recognized in Apprendi to this case. Here, the prior convictions that provided the basis for the defendant's enhanced sentence were obtained through procedures satisfying the fair notice, reasonable doubt, and jury trial guarantees. We note that section 5-5-3(c)(8) authorizes mandatory Class X sentencing when a defendant has been convicted of two prior Class 2 felonies or greater, which could only have been obtained as the result of proceedings that provided substantial procedural safeguards. 730 ILCS 5/5-5-3(c)(8) (West 1998). Moreover, we find the additional reasons recognized in Apprendi for applying the recidivism exception are also present in this case, because the defendant's prior convictions are not an essential element of the underlying criminal offense and the prior convictions do not relate to the commission of the underlying offense.
Our decision is in accordance with the principle of In re Winship, 397 U.S. 358, 90 S.Ct. 1068, 25 L.Ed.2d 368 (1970), which held that the fourteenth amendment right to due process and the sixth amendment right to trial by jury, taken together, entitle a criminal defendant to a jury determination that he is guilty of every element of the crime beyond a reasonable doubt. While section 5-5-3(c)(8) authorizes an increase of a defendant's sentence if defendant is convicted of a Class 1 or Class 2 felony after having twice been convicted of any Class 2 or greater class felonies, it does not in any way reduce the prosecution's burden to prove each element of the charged offense. As recognized in Apprendi, recidivism does not relate to the commission of the underlying offense but relates to punishment and, therefore, should not be treated as an essential element of the offense. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2362, 147 L.Ed.2d at 454. The language of section 5-5-3(c)(8) *386 "expresses a clear legislative intent to enhance the punishment of certain offenders based entirely on objective, historical criteria, their record of criminal convictions." People v. Thomas, 171 Ill.2d 207, 222, 215 Ill.Dec. 679, 664 N.E.2d 76 (1996). Prior conviction, or recidivism is a traditional, if not the most traditional, basis for increasing an offender's sentence. Almendarez-Torres, 523 U.S. at 243, 118 S.Ct. at 1230, 140 L.Ed.2d at 368. "[T]o hold that the Constitution requires that recidivism be deemed an `element' of petitioner's offense would mark an abrupt departure from a longstanding tradition of treating recidivism as `go[ing] to the punishment only. [Citation.]'" Almendarez-Torres, 523 U.S. at 244, 118 S.Ct. at 1231, 140 L.Ed.2d at 368-69.
We further recognize that, to treat recidivism as a fact that relates to the commission of the charged offense or as an element of the charged offense could result in significant prejudice to the defendant. Requiring the jury to decide the issue of whether a defendant has been twice convicted of two Class 2 or greater class felonies under section 5-5-3(c)(8) would force the State to introduce evidence of prior crimes during the guilt phase of defendant's jury trial. That requirement could increase the possibility of a jury finding a defendant guilty based on prior criminal conduct not on the conduct underlying the criminal charge being considered by the jury. Almendarez-Torres, 523 U.S. at 235, 118 S.Ct. at 1226, 140 L.Ed.2d at 362-63; People v. Lewis, 165 Ill.2d 305, 346, 209 Ill.Dec. 144, 651 N.E.2d 72 (1995). Moreover, the jury plays no role in imposing punishment. People v. Neeley, 18 Ill. App.3d 287, 309 N.E.2d 725 (1974). Yet, recidivism relates to punishment and its introduction during the guilt phase of the trial would not assist the jury in resolving the question of guilt. Such an interpretation and application of the Apprendi rule would be potentially unfair to the defendant because introduction at trial of evidence of a defendant's prior crimes poses the risk of significant prejudice to defendant. Spencer v. Texas, 385 U.S. 554, 560, 87 S.Ct. 648, 651-52, 17 L.Ed.2d 606, 612 (1967).
While the Supreme Court characterizes as a "matter of simple justice" its decision granting Apprendi the right to a jury trial on the racial bias factor which enhanced his sentence, application of the principles articulated by the Court can have serious repercussions. Proving sentencing enhancement factors to the same jury responsible for resolving the underlying criminal offense will not only put an additional burden on the prosecution during the charging, trial and jury instruction phases of the process, but will also inevitably interject against the defendant highly prejudicial evidence during the trial. This process will also raise questions for the defense including issues of jury bifurcation which would require first a jury determination as to guilt and then a separate jury determination as to the sentencing enhancement factors. Implementing the "simple justice" envisioned by Apprendi while maintaining fundamental fairness calls for more than simple solutions to the complex challenges created by that decision for the criminal justice system.
We are mindful that a defendant's recidivism is a narrow exception to the general rule articulated in Apprendi that the federal Constitution requires that any fact that increases the penalty for a crime beyond the prescribed statutory maximum must be alleged in the charging document, submitted to a jury, and proved beyond a reasonable doubt. Apprendi, 530 U.S. at ___, 120 S.Ct. at 2355, 147 L.Ed.2d at 446. The reasons recognized by Apprendi for applying the recidivism exception exist in this case and mitigate constitutional concerns regarding defendant's due process rights and jury trial guarantees. Here, procedural safeguards enhanced the validity of the defendant's prior convictions. Moreover, the defendant's prior convictions were not an essential element of the underlying offense and were not *387 related to the commission of the underlying offense. Consequently, we hold that the mandatory Class X sentencing provision of section 5-5-3(c)(8), which provides for sentencing enhancement based on prior convictions, is constitutional and does not violate defendant's due process rights or jury trial guarantees. 730 ILCS 5/5-5-3(c)(8) (West 1998). Under this mandatory Class X sentencing provision, a defendant's sentence is properly increased when the trial judge concludes at the sentencing hearing that evidence of the prior two convictions is accurate, reliable and satisfies the section 5-5-3(c)(8) statutory factors. Williams, 149 Ill.2d at 492, 174 Ill. Dec. 829, 599 N.E.2d 913; People v. La Pointe, 88 Ill.2d 482, 496, 59 Ill.Dec. 59, 431 N.E.2d 344 (1981). When a defendant's punishment is increased based on prior convictions, the prior convictions need not be alleged in the charging document, submitted to the jury or proven beyond a reasonable doubt because the prior convictions were obtained as the result of proceedings which provided procedural safeguards, the prior convictions were not an essential element of the underlying offense and the prior convictions were unrelated to the commission of the offense.

III. PRIOR CONVICTIONS NEED NOT BE ESTABLISHED BY HEIGHTENED STANDARD OF PROOF AT SENTENCING HEARING
Defendant alternatively argues that, should this court conclude that Apprendi and Jones do not require notice and a jury finding of proof beyond a reasonable doubt for sentencing enhancement based on prior convictions, nonetheless we should find section 5-5-3(c)(8) unconstitutional because due process requires that the facts qualifying defendant for enhanced Class X sentencing be proven at the sentencing hearing by a heightened standard of proof.
This argument has been rejected by our supreme court in People v. Williams, 149 Ill.2d 467, 174 Ill.Dec. 829, 599 N.E.2d 913 (1992). In Williams, the court held that the State was not required to prove defendant's prior convictions under section 5-5-3(c)(8) beyond a reasonable doubt. The court stated: "The fact that a judge finds a defendant eligible for a sentence under the Class X provision does not somehow result in the imposition of a higher standard of proof akin to the degree of proof that exists at trial." Williams, 149 Ill.2d at 492, 174 Ill.Dec. 829, 599 N.E.2d 913. Williams rejected the argument that at sentencing proof beyond a reasonable doubt of the prior convictions is required before a Class X sentence can be imposed on a defendant convicted of a Class 1 or Class 2 felony. Williams, 149 Ill.2d at 492, 174 Ill.Dec. 829, 599 N.E.2d 913. As interpreted by our supreme court in Williams, section 5-5-3(c)(8) imposes no burden of proof beyond that existing in any ordinary sentencing proceeding. Williams, 149 Ill.2d at 492, 174 Ill.Dec. 829, 599 N.E.2d 913.
Defendant contends that Almendarez-Torres requires sentencing determinations which bear significantly on the severity of the sentence to be subjected to a heightened standard of proof. Almendarez-Torres does not support defendant's argument that, at sentencing, prior convictions should be subject to a heightened standard of proof. We note that this issue was not addressed in Almendarez-Torres since defendant did not contest the accuracy of his prior convictions at the sentencing hearing. Moreover, the Court in Almendarez-Torres specifically stated: "[The Court] expresses no view on whether some heightened standard of proof might apply to sentencing determinations that bear significantly on the severity of sentence." 523 U.S. at 248, 118 S.Ct. at 1233, 140 L.Ed.2d at 371.
For the reasons previously discussed, prior convictions are specifically recognized by Apprendi as an exception to the general rule that the court applied to sentencing enhancement factors: "Other than *388 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 v. New Jersey, 530 U.S. 466, ___, 120 S.Ct. 2348, 2362-63, 147 L.Ed.2d 435, 455 (2000). Here, the prior convictions relied upon by the trial court in imposing the Class X sentence were previously established through procedures satisfying due process; therefore, they need not be established by a heightened standard of proof during the sentencing hearing.

IV. SENTENCE IS NOT EXCESSIVE
Defendant next contends that, based on the nature of the offense and the trial court's acknowledgment that his criminality was driven by drug addiction, his sentence is excessive. Defendant waived this issue by failing to raise it in a postsentencing motion. 730 ILCS 5/5-8-1(c) (West 1998); People v. Reed, 177 Ill.2d 389, 393-95, 226 Ill.Dec. 801, 686 N.E.2d 584 (1997). Even if defendant had not waived this issue, we find that the trial court did not abuse its discretion in imposing a 25-year prison sentence. The trial judge possesses substantial discretion in fashioning an appropriate sentence within statutory limits. People v. Wilson, 143 Ill.2d 236, 250, 157 Ill.Dec. 473, 572 N.E.2d 937 (1991). The trial court must base its sentence on the totality of circumstances of each case, giving due consideration to such factors as the "defendant's credibility, demeanor, general moral character, mentality, social environment, habits, and age." People v. Fern, 189 Ill.2d 48, 53, 243 Ill. Dec. 175, 723 N.E.2d 207 (1999). The reviewing court must additionally afford the trial judge great deference in imposing sentence, because the trial judge has personally observed the defendant, the proceedings, and sits in the best position to weigh these factors. Fern, 189 Ill.2d at 53, 243 Ill.Dec. 175, 723 N.E.2d 207. "A sentence within statutory limits will not be deemed excessive unless it is greatly at variance with the spirit and purpose of the law or manifestly disproportionate to the nature of the offense." Fern, 189 Ill.2d at 54, 243 Ill.Dec. 175, 723 N.E.2d 207.
In this case, the trial court did not abuse its discretion in imposing a 25-year prison sentence. The sentence falls within statutory limits of a Class X sentence. 730 ILCS 5/5-8-1(a)(3) (West 1998). Moreover, the record reflects the trial court considered all relevant factors, including the nature of the offense and defendant's credibility, habits, age, and character. The trial court weighed the evidence of defendant's drug addiction and his claims that he was receiving appropriate treatment for this addiction with defendant's criminal history, which included a pattern of crimes similar to the current offense. The trial court determined that, despite evidence of defendant's drug addiction as a motivating factor for his criminal conduct, an extensive term of imprisonment was necessary for the protection of society and sentenced defendant to a term of imprisonment within the statutory range. We do not find this sentence to be at variance with the purpose of the law and it is not disproportionate to the remedy provided under the law for purposes of sentencing a repeat offender. We find no abuse of discretion. People v. Perruquet, 68 Ill.2d 149, 154, 11 Ill.Dec. 274, 368 N.E.2d 882 (1977). Accordingly, we reject defendant's challenge that his sentence is excessive.
For the foregoing reasons, the judgment of the circuit court of Cook County is affirmed. Affirmed.
GALLAGHER and COHEN, JJ., concur.
