The State appeals from the district court’s ruling on the defendant Matthew Dale Rankin’s motion to dismiss. The State contends the district court erred by interpreting Iowa Code section 124.401(5) (2001) and ruling that Rankin should have been charged with a serious rather than an aggravated misdemeanor. We agree and reverse and remand.
I.Background Facts and Proceedings.
On June 28, 2002, Rankin was convicted of possession with intent to deliver marijuana in violation of Iowa Code section 124.401(l)(d) and 124.410 (2001). His conviction was determined to be an accommodation offense under section 124.410.
Two days later, a police officer stopped the car in which Rankin was a passenger for a traffic violation. According to the officer, as he approached the car he was “hit with a large amount of burnt marijuana smoke coming from inside the vehicle.” Rankin was trying to brush smoking ashes off his lap. The officer found a marijuana cigarette in the car and residue all over the passenger seat where Rankin was sitting.
The State charged Rankin with possession of marijuana in violation of Iowa Code section 124.401(5). The State also alleged that Rankin had previously been convicted of possession with intent to deliver on Juné 28, 2002, making the current offense an aggravated misdemeanor.
Rankin moved to dismiss. In his motion, Rankin asserted that no basis existed to charge him with the enhanced offense under section 124.401(5).
. Following a hearing,on-the motion, the district court, determined that the punishment would be that provided for a serious misdemeanor.
The State appealed, contending that the district court erred by interpreting section 124.401(5) and ruling that Rankin should have been' charged with a serious rather than an aggravated misdemeanor. For reasons that follow, we agree.
II. Scope of Review.
We review issues of statutory interpretation for errors at law. State v. Snyder, 634 N.W.2d 613, 615 (Iowa 2001).
III. Analysis.
We first begin our analysis wjth the fundamental rules of statutory interpretation that guide our resolution of the issue before us:
[In .interpreting statutes] [o]ur goal ... is to discover the true intention of the legislature. In searching for legislative intent, we consider not only the language of the statute, but also its. subject matter, the object sought to be aceom-plished, the purpose to be served, underlying. policies,, remedies provided, and the consequences of various interpretations. Additionally, we construe a statute in a way that would avoid impractical or absurd results. And'we look at the whole statute, not just separate parts. '
State v. Albrecht, 657 N.W.2d 474, 479 (Iowa 2003) (citations omitted);
Rankin contends the district court was' correct. In support of the district court’s ruling, Rankin argues, as he did in the district court, that at the time of the first conviction he'was sentenced pursuant to section 124.410, as though he had been convicted of possession of marijuana. Therefore, according to Rankin, the second paragraph of section 124.401(5) applied *610and the charge for a second offense should have been a serious misdemeanor rather than an aggravated misdemeanor under section 124.401(5). (An aggravated misdemeanor carries a sentence not to exceed two years (Iowa Code section 903.1(2)) and a serious misdemeanor under section 124.401(5) carries a sentence not to exceed six months for the first offense and not to exceed one year for a second offense under Iowa Code section 903.1(1)(6).)
To understand Rankin’s argument, we first set out Iowa Code section 124.410, the provision under which he was sentenced for his first conviction:
In a prosecution for unlawful delivery or possession with intent to deliver marijuana, if the prosecution proves that the defendant violated the provisions of section 124.401, subsection 1, by proving that the defendant delivered or possessed with intent to deliver one-half ounce or less of marijuana which was not offered for sale, the defendant is guilty of an accommodation offense and rather than being sentenced as if convicted for a violation of section 124.401, subsection 1, paragraph “d”, shall be sentenced as if convicted of a violation of section 12J/.401, subsection 5....
Iowa Code § 124.410 (emphasis added).
The second paragraph of section 124.401(5) — that part of the statute that Rankin claims applies — provides:
If the controlled substance is marijuana and the person has been previously convicted of a violation of this subsection in which the controlled substance was marijuana, the punishment shall be as provided in section 903.1, subsection 1, paragraph “b” [serious misdemeanor].
Iowa Code § 124.401(5) (emphasis added).
Reading these two provisions together as we must, we conclude, contrary to Rankin’s contention, that he was not “convicted of’ a violation of section 124.401(5) when he was sentenced under section 124.410 for his first offense. By the language “shall be sentenced as if convicted of a violation of’ section 124.401(5), the legislature simply intended that section 124.401(5) should only serve to supply the sentencing court with the proper sentence for a defendant found guilty of accommodation. A defendant found guilty of accommodation is not “convicted of’ a violation of section 124.401(5). Rather such a defendant is convicted of accommodation'— a delivery offense under section 124.410. See State v. Metcalf, 260 N.W.2d 857, 860 (Iowa 1977) (holding that accommodation is a lesser included offense of possession with intent to deliver); Iowa Code § 124.410 (“An accommodation offense may be proved as an included offense under a charge of delivering or possessing with the intent to deliver marijuana in violation of section 124.401, subsection 1.”).
We agree with the State that the second paragraph of section 124.401(5) does not apply to Rankin for two reasons. First, as we just explained, Rankin was not “convicted of’ a violation of section 124.401(5) when he was found guilty of an accommodation offense under section 124.410. Second, as the State correctly points out, the second paragraph of section 124.401(5) applies only to those persons convicted of possession of marijuana. Accommodation is a delivery offense; it is not a possession-of-marijuana offense. All of this is borne out by the following language in the second paragraph of section 124.401(5): “If the controlled substance is marijuana and the person has been previously convicted of a violation of this subsection in which the controlled substance was marijuana. ...” Iowa Code § 124.401(5) (emphasis added). Because Rankin was convicted of an accommodation offense in violation of section 124.410 and not a possession-of-*611marijuana offense, his previous conviction does not fall within the “this subsection” language of paragraph two of section 124.401(5).
As the State suggests, Rankin’s case falls within the following language of section 124.401(5) found in the first paragraph of that provision:
It is unlawful for any person knowingly or intentionally to possess a controlled substance.... Any person who violates this subsection is guilty of a serious misdemeanor for a first offense. A person who commits a violation of this subsection and who has previously been convicted of violating this chapter ... is guilty of an aggravated misdemeanor.
Rankin was previously convicted of violating sections 124.401(d) and 124.410 (“this chapter”). By using the language “this subsection,” rather than “this chapter,” in the second paragraph of section 124.401(5), the legislature clearly intended to grant leniency only to those charged with possession of marijuana.
We therefore conclude the State properly charged Rankin with an aggravated misdemeanor pursuant to the first paragraph of section 124.401(5). The district court erred in concluding otherwise. We therefore reverse the district court’s ruling on Rankin’s motion to dismiss and remand for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
All justices concur except CARTER, J., who dissents and STREIT, J., who takes no part.