
5 P.3d 1063 (2000)
Michael Richard SPEER, Appellant,
v.
The STATE of Nevada, Respondent.
No. 35587.
Supreme Court of Nevada.
August 21, 2000.
Richard F. Cornell, Reno, for Appellant.
Frankie Sue Del Papa, Attorney General, Carson City; Richard A. Gammick, District Attorney, and Terrence P. McCarthy, Deputy District Attorney, Washoe County, for Respondent.
BEFORE MAUPIN, SHEARING and BECKER, JJ.


*1064 OPINION

PER CURIAM:
The issue before this court is whether a felony DUI conviction may be used as a prior offense to enhance a subsequent DUI conviction to a felony. We conclude that it may.

FACTS
Appellant Michael Richard Speer pleaded guilty to driving under the influence in violation of NRS 484.379. At sentencing, the State offered evidence of two prior convictions for the same or similar conduct within the preceding seven years. One of the prior convictions was entered in connection with a misdemeanor offense that occurred in 1996; the other involved a felony offense that occurred in 1991. The 1991 offense was enhanced to a felony because Speer had two or more DUI convictions prior to the 1991 offense. The 1996 offense was treated as an unenhanced "first offense" pursuant to a plea agreement; however, the parties agreed that the conviction would not be treated as a "first offense" for all purposes and that Speer's next offense could be treated as a felony.
Speer did not challenge the use of the prior convictions for enhancement purposes. The district court found that the State had proved that Speer had sustained two valid prior convictions and enhanced the offense to a felony. The court sentenced appellant to 28 to 72 months.
Speer subsequently filed a post-conviction petition for a writ of habeas corpus. Among other things, Speer claimed that the district court erred in using a prior felony conviction for enhancement purposes. Speer argued that only offenses denominated as a "first offense" or "second offense" may be used for enhancement. The district court denied the petition. This timely appeal followed.

DISCUSSION
Speer contends that the district court erred in rejecting his claim that the 1991 DUI conviction could not be used for enhancement purposes because it was a felony conviction. Speer essentially argues that under NRS 484.3792 only misdemeanor convictions may be used to enhance a subsequent offense to a felony. We disagree.
The issue raised in this appeal requires this court to interpret the sentencing scheme set forth in NRS 484.3792. "The construction of a statute is a question of law." Anthony Lee R., A Minor v. State, 113 Nev. 1406, 1414, 952 P.2d 1, 6 (1997). "Generally, when the words in a statute are clear on their face, they should be given their plain meaning unless such a reading violates the spirit of the act." Id. However, statutory language should be construed to avoid absurd or unreasonable results, id., and "`no part of a statute should be rendered nugatory, nor any language turned to mere surplusage, if such consequences can properly be avoided.'" Paramount Ins. v. Rayson & Smitley, 86 Nev. 644, 649, 472 P.2d 530, 533 (1970) (citation omitted).
Nevada law provides for a graduated scheme of sentence enhancements for DUI convictions which is based on the number of prior offenses within a given period of time. See NRS 484.3792. A person who violates NRS 484.379:(1) "[f]or the first offense within 7 years, is guilty of a misdemeanor"; (2) "[f]or a second offense within 7 years, is guilty of a misdemeanor"; and (3) "[f]or a third or subsequent offense within 7 years, is guilty of a category B felony." NRS 484.3792(1). The statute further provides: "An offense that occurred within 7 years immediately preceding the date of the principal offense or after the principal offense constitutes a prior offense for the purposes of this section when evidenced by a conviction, without regard to the sequence of the offenses and convictions." NRS 484.3792(2).
We conclude that NRS 484.3792 is clear and unambiguous: any two prior offenses may be used to enhance a subsequent DUI so long as they occurred within 7 years of the principal offense and are evidenced by a conviction. The statute does not limit offenses that may be used for enhancement to those designated as a "first offense" or a "second offense." In other words, the statute does not limit the use of prior offenses for enhancement purposes to misdemeanors. Rather, the statute provides that an offense, *1065 as defined by NRS 484.3792(8), that occurred within 7 years immediately preceding or after the date of the principal offense constitutes a prior offense for enhancement purposes. See NRS 484.3792(2). Thus, the key requirements for enhancement are whether the offense meets the requirements of NRS 484.3792(8) and whether it occurred within 7 years of the principal offense. Whether the prior offense was a misdemeanor or a felony is not otherwise relevant under the statute. We therefore conclude that the statute clearly allows the use of a felony conviction for enhancement purposes so long as the felony conviction was for an offense occurring within the requisite 7-year period.[1]
Speer contends that this interpretation of the statute has been considered and rejected by this court in a series of prior decisions. We disagree.
In several prior cases, this court has held that a second DUI conviction may not be used to enhance a conviction for a third DUI arrest to a felony where the second conviction was obtained pursuant to a guilty plea agreement specifically permitting the defendant to enter a plea of guilty to first offense DUI and limiting the use of the conviction for enhancement purposes. See, e.g., State v. Crist, 108 Nev. 1058, 843 P.2d 368 (1992); Perry v. State, 106 Nev. 436, 794 P.2d 723 (1990); State v. Smith, 105 Nev. 293, 774 P.2d 1037 (1989). Our decisions in Crist, Perry and Smith were based solely on the necessity of upholding the integrity of plea bargains and the reasonable expectations of the parties relating thereto. See Grover v. State, 109 Nev. 1019, 862 P.2d 421 (1993). The rule recognized in these cases is not applicable where, as here, there is no plea agreement limiting the use of the prior conviction for enhancement purposes. See id. Because our prior decisions in Crist, Perry and Smith depend on the existence of a plea agreement limiting the use of the prior conviction for enhancement purposes, they do not stand for the general proposition that only offenses designated as a "first" or "second" offense may be used for enhancement purposes. We therefore conclude that Speer's reliance on those cases is misplaced.
Speer also argues that the interpretation adopted in this opinion is contrary to legislative intent because the legislature has rejected attempts to amend NRS 484.3792 to provide that once a defendant suffers an enhanced felony DUI conviction any subsequent DUI is a felony. However, we conclude that our interpretation of the statute does not necessarily lead to the same result as the amendments that the legislature has rejected. The amendments addressed by Speer essentially sought to eliminate the 7-year requirement once a person has sustained a felony conviction. By giving effect to the language in NRS 484.3792(1)(c), we have not eliminated the 7-year requirement. A defendant still must have at least two prior offenses within 7 years of the charged offense for the charged offense to be enhanced to a felony. See NRS 484.3792(2). The interpretation we endorse today comports with the plain language of the statute and gives meaning to all of the language in the statute.[2]

CONCLUSION
We conclude that a prior felony DUI conviction may be used to enhance a subsequent DUI conviction so long as the prior offense occurred within 7 years immediately preceding the date of the principal offense or after the principal offense. We therefore conclude that the district court did not err in rejecting Speer's claim that the 1991 felony *1066 conviction could not be used for enhancement purposes.[3]
NOTES
[1]  We note that the interpretation urged by Speer would lead to absurd results and would render the phrase "or subsequent offense" in NRS 484.3792(1)(c) superfluous. For these reasons, we also reject Speer's interpretation.
[2]  Speer also argues that the 1991 felony conviction was impermissibly "double counted." The legal underpinnings of this contention are not entirely clear. Most of the cases cited by Speer involved the use of a single prior conviction to enhance the primary offense to a felony and then also to sentence the defendant for the primary offense under a general habitual felon statute. Even assuming these cases correctly state the law, Speer's 1991 felony conviction was not used both to enhance the instant offense to a felony and to adjudicate Speer as a habitual felon with respect to the instant offense. We therefore conclude that this contention lacks merit.
[3]  We acknowledge that the issue addressed in this opinion appears to be a direct appeal issue that cannot be raised in a post-conviction petition for a writ of habeas corpus challenging a conviction based on a guilty plea. See NRS 34.810(1)(a); Franklin v. State, 110 Nev. 750, 877 P.2d 1058 (1994) (issues that could have been raised on direct appeal from a judgment of conviction based on a guilty plea are waived), overruled in part on other grounds by Thomas v. State, 115 Nev. 148, 979 P.2d 222 (1999). Speer raised this issue in his amended supplemental petition as a claim of ineffective assistance of counsel. However, the district court's order appears to resolve the issue on its merits, not in the context of an ineffective assistance claim. The appellate briefs address the issue in a similar fashion. We conclude that the merits of the underlying issue would be relevant to an examination of whether counsel provided ineffective assistance by failing to raise the issue at or before sentencing and, therefore, we have addressed the merits of the issue raised on appeal. Because we conclude that the issue raised lacks merit, we further conclude that trial counsel was not deficient for failing to raise the issue. See Strickland v. Washington, 466 U.S. 668, 104 S.Ct. 2052, 80 L.Ed.2d 674 (1984).
