
278 Kan. 121 (2004)
92 P.3d 578
STATE OF KANSAS, Appellee,
v.
THERESA A. BARNES, Appellant.
No. 89,628.
Supreme Court of Kansas.
Opinion filed June 25, 2004.
Randall L. Hodgkinson, deputy appellate defender, argued the cause, and Steven R. Zinn, deputy appellate defender, was with him on the briefs for appellant.
Kim W. Cudney, county attorney, argued the cause, and Phill Kline, attorney general, was with him on the briefs for appellee.
The opinion was delivered by
LUCKERT, J.:
Theresa Barnes pled guilty to aiding and abetting the manufacture of methamphetamine, possession of methamphetamine, possession of methamphetamine with intent to sell, possession of drug paraphernalia, and endangering a child. In State v. Barnes, No. 89,628, unpublished opinion filed November 7, 2003, the Court of Appeals upheld her sentences, holding in part that there was no error in sentencing Barnes for aiding and abetting the manufacture of methamphetamine as a drug severity level 1 felony pursuant to K.S.A. 65-4159(a) rather than as a drug severity level 3 felony pursuant to K.S.A. 65-4161(a). This court granted Barnes' petition for review on the sole issue of whether State v. McAdam, 277 Kan. 136, 83 P.3d 161 (2004), applies.

Facts
In December 2001, Barnes was arrested for various drug-related offenses following the execution of a search warrant at her home. *122 Pursuant to a plea agreement in which other charges were dismissed, Barnes pled guilty and was sentenced to a controlling term of 146 months' imprisonment based upon her most serious conviction of aiding and abetting the manufacture of methamphetamine; all other sentences were ordered to run concurrently.
On direct appeal, Barnes raised several sentencing issues. The Court of Appeals held that although the offenses of manufacture of methamphetamine under K.S.A. 65-4159(a) and compounding a stimulant under K.S.A. 65-4161 contained identical elements, the sentencing court correctly sentenced Barnes for a drug severity level 1 felony under K.S.A. 65-4159(a) as the more specific provision. The Court of Appeals also held that the lesser misdemeanor penalty under K.S.A. 65-4127c did not apply and that the sentencing court did not err in imposing a drug severity level 4 felony sentence for Barnes' conviction of possession of drug paraphernalia.
This court granted Barnes' petition for review as to the first issue only and directed the State to show cause why McAdam, 277 Kan. 136, should not apply to Barnes' case. Both the State and Barnes responded to the show cause order; their arguments will be discussed below.

Does McAdam Require that Barnes be Resentenced for a Drug Severity Level 3 Felony for her Conviction of Aiding and Abetting the Manufacture of Methamphetamine?
In McAdam, the defendant was convicted of conspiracy to unlawfully manufacture methamphetamine and was sentenced for a drug severity level 1 felony pursuant to K.S.A. 65-4159(a). This court compared K.S.A. 65-4159(a), which makes manufacturing methamphetamine a drug severity level 1 felony, with K.S.A. 65-4161(a), which makes compounding a stimulant a drug severity level 3 felony. The court found the offenses were identical under the facts of the case; therefore, the defendant could be sentenced only under the lesser penalty provisions of K.S.A. 65-4161(a). 277 Kan. at 142-47.
The State contends that McAdam does not control Barnes' case because Barnes received the benefit of a favorable plea agreement.
*123 Barnes argues that her guilty plea is of no significance because, under McAdam, the imposition of a drug severity level 1 felony sentence was an illegal sentence. She argues that an illegal sentence must be vacated even when entered following a guilty plea, citing State v. Santos-Garza, 276 Kan. 27, 72 P.3d 560 (2003), and State v. Cullen, 275 Kan. 56, 60 P.3d 933 (2003). However, the sentences in Santos-Garza and Cullen were illegal because they were based on an unconstitutional sentencing scheme. See Santos-Garza, 276 Kan. 27, Syl.; Cullen, 275 Kan. 56, Syl. ¶ 1. The sentence in McAdam was not unconstitutional. See United States v. Batchelder, 442 U.S. 114, 60 L. Ed. 2d 755, 99 S. Ct. 2198 (1979) (when defendant sentenced under statute with greater penalty even though same conduct violated similar statute with lesser penalty, no violations of Equal Protection or Due Process Clauses of United States Constitution). Rather, the problem when two statutes have identical elements but carry different penalties is that "`"the decision as to which penalty to seek cannot be a matter of prosecutorial whimsy in charging."'" McAdam, 277 Kan. at 145 (quoting State v. Clements, 241 Kan. 77, 83, 734 P.2d 1096 [1987]).
Like Barnes, McAdam failed to raise the sentencing issue before the trial court. While the Court of Appeals chose to address the issue based upon McAdam's assertion that his sentence was illegal, on petition for review this court did not address the illegal sentence issue, merely stating that we were reviewing the Court of Appeals' decision. 277 Kan. at 142. See Supreme Court Rule 8.03(g)(1) (2003 Kan. Ct. Rules Annot. 58).
McAdam is grounded upon Clements and State v. Nunn, 244 Kan. 207, 768 P.2d 268 (1989). Nunn, 244 Kan. at 229, adopts the holding in Clements that "`[a]s to identical offenses, a defendant can only be sentenced under the lesser penalty.' 241 Kan. at 83." Neither case holds the underlying sentence to be illegal.
Thus, we must examine our prior interpretation of the term "illegal sentence" as that phrase is used in K.S.A. 22-3504(1) which allows correction of an illegal sentence at any time:
"We have defined an illegal sentence as a sentence imposed by a court without jurisdiction, a sentence which does not conform to the statutory provision, either in the character or the term of the punishment authorized, or a sentence which *124 is ambiguous with respect to the time and manner in which it is to be served [Citations omitted.]" State v. Duke, 263 Kan. 193, 194, 946 P.2d 1375 (1997).
There is no question that the district court had jurisdiction to find Barnes guilty and impose sentence. Further, Barnes' sentence conformed to K.S.A. 65-4159 as to both its character and term of punishment. Her sentence was not ambiguous in the time or manner in which it was to be served. Thus, Barnes' sentence was not "illegal."
The conclusion that Barnes' sentence was not illegal does not, however, deprive this court of jurisdiction to hear Barnes' appeal because K.S.A. 21-4721(e) provides: "In any appeal, the appellate court may review a claim that . . . (3) the sentencing court erred in ranking the crime severity level of the current crime."
Nor does the conclusion that the sentence is not illegal end our analysis of whether Barnes is entitled to relief. Barnes argues that McAdam should apply to any appeal pending at the time of the decision. In support, she cites State v. Hood, 242 Kan. 115, 744 P.2d 816 (1987). Hood applied the new constitutional rule from Batson v. Kentucky, 476 U.S. 79, 90 L. Ed. 2d 69, 106 S. Ct. 1712 (1986), to the defendant's case which was pending on direct appeal and remanded for the trial court to determine whether the Batson factors were met. 242 Kan. at 117-23. See also State v. Gould, 271 Kan. 394, 414, 23 P.3d 801 (2001) (applying new constitutional sentencing rule to cases pending on direct appeal). However, as mentioned above, McAdam did not involve a constitutional rule.
Another theory for applying McAdam is the rule that overruling decisions are applied retroactively to all similar cases pending at the time of the decision. State v. Waterberry, 248 Kan. 169, 172, 804 P.2d 1000 (1991) (expanding application of State v. Hall, 246 Kan. 728, 793 P.2d 737 [1990], analysis regarding claims of defective information to all cases pending on date of Hall opinion).
However, this court has refused to apply this general rule when the prior decision was not an "overruling" decision. In State v. Alford, 257 Kan. 830, 839-40, 896 P.2d 1059 (1995), the defendant sought to have the ruling in State v. Willis, 254 Kan. 119, 130-31, 864 P.2d 1198 (1993), apply because his case was pending on direct *125 appeal when Willis was decided. Willis added a clarifying phrase to the PIK Crim. 3d 56.01-B sentencing instruction regarding whether a crime is committed in an especially heinous, atrocious, or cruel manner. Willis stated that the new instruction should be used in all cases on appeal of the date of the opinion where the vagueness of the instruction had been raised as an issue on appeal. However, State v. Duke, 256 Kan. 703, 717, 887 P.2d 110 (1994), modified the statement in Willis and held that the new instruction should be used only in cases where the vagueness of the instruction had been raised in both the trial court and as an issue on appeal. See Alford, 257 Kan. at 839. The Alford court found that Willis was not an overruling decision because it merely supplemented the existing sentencing instruction. Since the defendant had failed to raise the vagueness of the instruction before the trial court, the Alford court refused to consider the defendant's argument on appeal. 257 Kan. at 840.
Similarly, McAdam is not an overruling decision in the sense that it did not expressly overrule prior case law and did not hold any law unconstitutional. While McAdam did reverse the relevant portion of the Court of Appeals' earlier decision, since that decision never became final as a result of the petition for review being granted, it cannot be said that the Court of Appeals was overruled. There were also several unpublished Court of Appeals decisions which reached a different result. See State v. Scott, No. 89,945, unpublished opinion filed January 16, 2004, and State v. Ramsey, No. 89,856, unpublished opinion filed January 9, 2004. However, petitions for review are pending in those cases. Thus, Barnes is not entitled to relief under the theory that overruling cases are retroactively applied to all similar cases pending on appeal.
The State argues it would be an improper retroactive application of McAdam to apply it in this case and asks us to follow the analysis regarding retroactivity that was adopted in Wilson v. State, 31 Kan. App. 2d 728, 71 P.3d 1180, rev. denied 276 Kan. 974 (2003). Wilson involved a collateral proceeding under K.S.A. 60-1507 in which the defendant asked the Court of Appeals to retroactively apply its earlier decision in State v. Frazier, 30 Kan. App. 2d 398, 42 P.3d 188, rev. denied 274 Kan. 1115 (2002). Frazier held that possession *126 of ephedrine and possession of drug paraphernalia were identical offenses; thus, the defendant could be sentenced only under the lesser penalty. 30 Kan. App. 2d at 405-06. The Wilson court declined to apply Frazier retroactively in a collateral attack on a conviction where the defendant had received the benefit of a favorable plea bargain and had failed to raise the sentencing issue in a direct appeal. Wilson, 31 Kan. App. 2d at 734.
The Wilson court considered the approach taken in State v. Williams, 250 Kan. 730, 829 P.2d 892 (1992), and Carmichael v. State, 255 Kan. 10, 872 P.2d 240 (1994), cases where the defendants were convicted of a general sex crime rather than the more specific crime of aggravated incest which carried a lesser penalty. Williams held that where a defendant is related to the victim, the defendant must be charged with the more specific crime of aggravated incest rather than the general crime of indecent liberties with a child. 250 Kan. at 736-37. While Williams addressed the issue in the context of a direct appeal, Carmichael was a collateral attack. The Carmichael court held that the defendant's rape sentences must be vacated and that he should be resentenced for aggravated incest. 255 Kan. at 19-20.
The Wilson court distinguished Carmichael because it involved specific versus general crimes rather than identical crimes. We note that this same distinction applies when considering LaBona v. State, 255 Kan. 66, 872 P.2d 271 (1994), which was not considered by the Wilson court but involved the same issue as Williams and Carmichael. In LaBona, this court held that by pleading guilty to two counts of indecent liberties with a child, the defendant waived the right to challenge the State's failure to charge the specific offense of aggravated incest and acquiesced in his convictions. 255 Kan. at 69-70.
The Wilson court chose to rely on Easterwood v. State, 273 Kan. 361, 383, 44 P.3d 1209 (2002), a case holding that intervening appellate decisions interpreting the felony-murder statute did not apply retroactively to a defendant's collateral attack on his felony-murder conviction. Wilson, 31 Kan. App. 2d at 732-34.
There are two important distinctions between Wilson and this case, the first being that Wilson involved a collateral attack rather *127 than a direct appeal. Barnes' case was pending on direct appeal when McAdam was decided. The second distinction is related to the first. While in Wilson the defendant failed to raise the sentencing issue on direct appeal, Barnes has raised the sentencing issue on direct appeal, although she admittedly did not raise the issue before the trial court. Because this case is not a collateral attack, much of the Wilson court's analysis is inapplicable here. The question presented in this case is not whether the McAdam rule can be asserted in a collateral attack.
The analysis which is more applicable to this case is that found in State v. Chandler, 17 Kan. App. 2d 512, 515, 839 P.2d 551 (1992). In Chandler, the defendant was convicted of aggravated incest, indecent liberties with a child, and aggravated criminal sodomy. The victim of all three offenses was the defendant's 13-year-old daughter. While Chandler's direct appeal was pending, this court filed its opinion in Williams, 250 Kan. at 736-37, holding that where a defendant is related to the victim, the State must charge the defendant with the more specific crime of aggravated incest rather than the general crime of indecent liberties.
The Chandler court held that under Williams, the defendant's convictions for indecent liberties and aggravated criminal sodomy must be reversed because the defendant could only be convicted of the more specific crime of aggravated incest. 17 Kan. App. 2d at 514. The court rejected the State's argument that Williams should not apply and that it would be a retroactive application, ruling that Williams merely applied a longstanding principle (general versus specific statutes) to circumstances not previously addressed in other cases. No new law had been pronounced; thus, the application of Williams did not truly constitute retroactive application of case law. 17 Kan. App. 2d at 515.
Similarly, McAdam does not establish a "new rule of law" but is rather a case applying the principles enunciated in Nunn and Clements to existing statutes. Thus, the McAdam rule should apply to this case which was a direct appeal pending as of the date of the McAdam decision.
Finally, we must consider the State's position that Barnes should not be allowed relief from her sentence because she pled guilty to *128 the offense while McAdam was found guilty after a trial. As part of Barnes' plea agreement, several counts were dismissed. Although it involved a different substantive issue, the procedural history recounted in another case, State v. Heywood, 245 Kan. 615, 783 P.2d 890 (1989), is enlightening. Heywood pled guilty to aggravated criminal sodomy. While his appeal was pending, this court decided Clements, 241 Kan. 77, which held that the elements of aggravated criminal sodomy, a class B felony, were identical to the elements of indecent liberties with a child, a class C felony; thus, the defendant could only be sentenced under the lesser penalty. Without a hearing, this court remanded Heywood's case for resentencing in light of Clements even though Heywood had pled guilty. After resentencing, Heywood raised the substantive issue of whether the district court abused its discretion in resentencing Heywood. See Heywood, 245 Kan. at 616-22. The same situation arises in this case and, under Heywood, the appropriate disposition would be to remand for resentencing.
One other issue was raised at oral argument by the State when it requested us to consider the application of Substitute for House Bill 2777, which at the time of argument had not been signed into law. Subsequently, the Governor signed the legislation and it became effective on May 20, 2004, upon publication in the Kansas Register. See 23 Kan. Reg. 720 (2004). The legislation deletes the phrase "or compound" from K.S.A. 65-4161(a) and K.S.A. 65-4163(a) so that they no longer charge the crime defined in K.S.A. 65-4159. Obviously, this provision was not in effect on the date Barnes committed the crime or even at the time of conviction, sentence, or appeal. "Criminal statutes and penalties in effect at the time of the criminal act are controlling. [Citation omitted]." State v. Martin, 270 Kan. 603, 605, 17 P.3d 344 (2001).
However, the legislature included a retroactive provision, stating:
"New Sec. 3. On or before the effective date of this act, any person violating the provisions of K.S.A. 65-4159, and amendments thereto, upon conviction, is guilty of a drug severity level 1 felony. Such sentence shall not be reduced to violating the provisions of K.S.A. 65-4161 or 65-4163, and amendments thereto, *129 because prior to this act, such statutes prohibited the identical conduct." Substitute for House Bill 2777.
Despite this statement of legislative intent, there are limitations upon the retroactivity of legislation. The Ex Post Facto Clause of the United States Constitution forbids legislative enactments which impose a punishment for an act which was not punishable when it was committed or which impose additional punishments to those then prescribed. A law is ex post facto if two critical elements are present: the law must be retrospective and it must change the definition of criminal conduct or increase the penalty for the criminal conduct. Sammons v. Simmons, 267 Kan. 155, 162, 976 P.2d 505 (1999).
In this situation, Substitute for House Bill 2777 increases the penalty to which Barnes would be subject if the legislation is applied to her. Without the legislation she must be sentenced for a drug severity level 3 felony under the McAdam decision; if the legislation is effective as to her, she would be sentenced for a drug severity level 1 felony. Therefore, the retroactivity provision cannot be constitutionally applied to Barnes.
Consistent with our past treatment of cases in similar circumstances where the issue was identical crimes with differing penalties, we hold that the decision in McAdam should be applied to Barnes' case since it was pending on appeal at the time of the decision in McAdam.

Was McAdam Wrongly Decided?
The State also contends that McAdam was wrongly decided because it did not take into account the legislative history behind K.S.A. 65-4159(a), which shows that the legislature intended to enhance the penalty for persons who manufacture methamphetamine. Barnes counters that questions of legislative intent are irrelevant where the statutes involved are clear and unambiguous. See State v. Thrash, 267 Kan. 715, 716-17, 987 P.2d 345 (1999) ("When a statute is plain and unambiguous, the appellate courts will not speculate as to the legislative intent behind it and will not read such a statute so as to add something not readily found in the statute.")
*130 The McAdam court characterized legislative intent as "the critical issue" in the case. 277 Kan. at 143. However, the court considered the wording of the statutes involved as evidence of legislative intent rather than looking at legislative history. 277 Kan. at 144. "The legislature is presumed to have expressed its intent through the language of the statutory scheme it enacted." State v. Brown, 272 Kan. 843, 846, 35 P.3d 910 (2001).
Whatever the legislature may have intended (which they have not clarified with Substitute for House Bill 2777), the end result was that it created two statutes which, under the facts presented in McAdam and this case, contained identical elements but provided different penalties. As a result, under the rule stated in Nunn, Clements, and now McAdam, a defendant can only be sentenced to the lesser penalty.
The State has failed to establish why McAdam should not apply to this appeal. Barnes' sentence for aiding and abetting the manufacture of methamphetamine is vacated and the case is remanded for resentencing consistent with McAdam.
Sentence vacated and case remanded for resentencing consistent with this opinion.
