              IN THE SUPREME COURT OF THE STATE OF KANSAS

                                       No. 109,472

                                    STATE OF KANSAS,
                                       Appellant,

                                             v.

                                     DANIEL W. TIMS,
                                        Appellee.


                              SYLLABUS BY THE COURT


1.
       A person accused of a misdemeanor has a Sixth Amendment right to counsel if the
sentence to be imposed upon conviction includes a term of imprisonment, even if the jail
time is suspended or conditioned upon a term of probation. The right to counsel arises at
the stage of the proceedings where guilt is adjudicated, eligibility for imprisonment is
established, and the prison sentence determined.


2.
       An uncounseled misdemeanor conviction obtained in violation of a defendant's
Sixth Amendment right to counsel (i.e., an uncounseled conviction that resulted in a
prison sentence, even if the sentence was suspended or conditioned upon a term of
probation) may not be collaterally used for sentence enhancement in a subsequent
criminal proceeding. Conversely, an uncounseled misdemeanor conviction that resulted
in no prison sentence being imposed may be used to enhance punishment for a
subsequent conviction without violating the Sixth Amendment.




                                             1
3.
       Though a driving under the influence (DUI) diversion is considered a prior
conviction pursuant to K.S.A. 2011 Supp. 8-1567(j), the diversion does not have an
underlying sentence attached to it and, thus, is distinguishable from a misdemeanor
conviction resulting in a suspended jail sentence. An uncounseled DUI diversion is more
analogous to an uncounseled misdemeanor conviction that did not result in any jail
sentence. Consequently, an uncounseled DUI diversion can properly be used to enhance
punishment for a subsequent DUI conviction without violating a defendant's
constitutional right to counsel.


4.
       Based on the language of K.S.A. 12-4414(c), a defendant has a statutory right to
be represented by counsel at a DUI diversion conference with a city attorney.


5.
       The certification language suggested by this court in State v. Hughes, 290 Kan.
159, 224 P.3d 1149 (2010), and In re Habeas Corpus Application of Gilchrist, 238 Kan.
202, 708 P.2d 977 (1985), to ensure that a municipal court judge properly advises a
defendant of his or her constitutional right to counsel is not required for a diversion
agreement to be valid because the constitutional right to counsel does not attach during
diversion proceedings.


6.
       Any waiver of the statutory right to be represented by counsel during a diversion
conference must be knowing and voluntary. The language of the diversion agreement
controls appellate review of the soundness of the waiver.


                                              2
7.
        Diversion agreements are to be interpreted in accordance with contract principles.
An appellate court exercises unlimited review over the interpretation and legal effect of
written instruments. The primary rule for interpreting written contracts is to ascertain the
parties' intent. If the terms of the contract are clear, the intent of the parties is to be
determined from the language of the contract without applying rules of construction.


        Review of the judgment of the Court of Appeals in 49 Kan. App. 2d 845, 317 P.3d 115 (2014).
Appeal from Jackson District Court; MICHEAL A. IRELAND, judge. Opinion filed August 14, 2015.
Judgment of the Court of Appeals reversing and remanding to the district court is affirmed in part and
vacated in part. Appeal sustained on question reserved.


        Timothy Liesmann, assistant county attorney, argued the cause, and Derek Schmidt, attorney
general, was on the briefs for appellant.


        Kevin P. Shepherd, of Topeka, argued the cause and was on the briefs for appellee.


The opinion of the court was delivered by


        ROSEN, J.: Daniel W. Tims appeals the Court of Appeals' decision in State v.
Tims, 49 Kan. App. 2d 845, 317 P.3d 115 (2014), reversing the district court's decision
holding that Tims' 2002 uncounseled driving under the influence (DUI) diversion could
not be counted as a prior DUI conviction for purposes of determining his sentence for his
current DUI conviction. The Court of Appeals found that Tims' Sixth Amendment right
to counsel did not attach during the 2002 diversion proceedings. The court also concluded
that though Tims had a statutory right to counsel during the diversion proceedings, the
diversion agreement that Tims signed showed that he had validly waived this statutory
right. Accordingly, the Court of Appeals determined that Tims' 2002 DUI diversion could

                                                    3
be properly counted as a prior conviction and, thus, remanded Tims' case with directions
that his current DUI conviction be classified and sentenced as a felony third DUI.


       We granted Tims' petition for review to determine whether, absent a valid waiver
of the right to counsel, an uncounseled DUI diversion can be considered as a prior
conviction for classification and sentencing purposes in a subsequent DUI proceeding
without violating a defendant's constitutional or statutory right to counsel.


                                                  FACTS


       Tims does not contest the accuracy of the Court of Appeals' recitation of the facts
in its opinion. That portion of the opinion is quoted below:


               "The Jackson County District Court found Tims guilty of driving under the
       influence of alcohol in June 2012. This was not Tims' first DUI. In 2002, Tims executed a
       DUI diversion agreement in the Topeka Municipal Court. There is no evidence in the
       record regarding whether Tims successfully completed the diversion; however, Tims
       makes no claim that he served jail time in connection with his Topeka offense; Tims'
       presentence investigation report lists it as a diversion and not a conviction; and since it is
       the subject of this appeal, we presume the diversion was never revoked and no sentence
       was imposed. Tims was convicted of another DUI in 2004.
               "Based upon the 2002 DUI diversion and the 2004 DUI conviction, in 2012 the
       State charged Tims with felony DUI under K.S.A. 2011 Supp. 8-1567(a)(5) and
       (b)(1)(D). Curiously, Tims waived his preliminary hearing then subsequently filed a
       Motion to Strike Diversion from Consideration of Defendant's Criminal History and
       Discharge from Felony Charges. After the State responded only to the merits of the
       motion and not its procedural propriety, the district court heard arguments and granted
       Tims' motion. The State then filed a motion to reconsider, resulting in a brief hearing and
       denial by the district court. Thereafter, the parties agreed to a bench trial upon stipulated
       facts. The State reserved the right to appeal the district court's sentencing decision based
       on the court's exclusion of Tims' 2002 DUI diversion from his criminal history.
                                                     4
               "The district court found Tims guilty, treated his conviction as a second
       misdemeanor DUI conviction, and sentenced him to probation. The State timely
       appeal[ed] based on an illegal sentence and on a question reserved." Tims, 49 Kan. App.
       2d at 847.


       The Court of Appeals, relying on State v. Key, 298 Kan. 315, 322-23, 312 P.3d
355 (2013) ("A defendant who intends to challenge the validity of a prior misdemeanor
DUI as a classifying factor for a DUI felony charge under K.S.A. 8-1567 should
challenge the prior misdemeanor at preliminary hearing . . ."), found that because Tims
waived his right to a preliminary hearing, he waived his right to challenge the
classification of the current DUI as a nonperson felony. Additionally, the panel, relying
on State v. Bell, 268 Kan. 764, 768, 1 P.3d 325 (2000) (once probable cause existed to
bind defendant over on charge, judge had no authority to amend charge), and State v.
Leslie, 237 Kan. 318, 319, 699 P.2d 510 (1985) (magistrate judge had no authority to
amend felony charge to misdemeanor at the conclusion of preliminary hearing),
concluded that once Tims waived his right to a preliminary hearing, the district court did
not have the authority to reclassify the DUI charge as a misdemeanor. The panel also
determined that because the State was challenging the legality of Tims' sentence based on
the assertion that he should have received a sentence for a felony third DUI instead of a
misdemeanor second DUI, the State's appeal was properly before it under K.S.A. 22-
3504. Tims, 49 Kan. App. 2d at 848-50. Tims did not challenge these conclusions in his
petition for review and, thus, they are waived. See State v. Holman, 295 Kan. 116, 125,
284 P.3d 251 (2012) (An issue not briefed by the appellant is deemed waived and
abandoned.).


       Regarding the merits of the State's argument, the panel found that the district court
erred in not considering Tims' 2002 DUI diversion as a prior conviction for sentence
enhancement purposes. Based on precedent from the United States Supreme Court and

                                                   5
this court, the panel concluded that Tims' Sixth Amendment right to counsel did not
attach during the 2002 diversion proceedings and, thus, his diversion could be properly
considered for sentencing purposes without violating his constitutional rights. The panel,
however, found that based on K.S.A. 12-4416(a), Tims had a statutory right to counsel
during the diversion conference with the city prosecutor. But based on the language
within the diversion agreement that Tims signed, the panel concluded that Tims validly
waived his statutory right to counsel. The panel specifically rejected Tims' argument that
in order for his waiver to have been valid, there had to be a written certification from a
municipal court judge stating that the judge fully advised Tims of his right to counsel and
that Tims knowingly and voluntarily waived that right in front of the judge. The panel
reasoned that because a diversion agreement is a contract solely between a prosecutor and
a defendant, there was no need for a judge's certification on the diversion agreement.
Thus, the Court of Appeals reversed the decision of the district court and remanded the
case for resentencing as a felony conviction for a third DUI. Tims, 49 Kan. App. 2d at
852-58.


       Tims' failure to seek review of these procedural and jurisdictional conclusions on
petition for review constitutes a waiver of the issues under State v. Holman, 295 Kan.
116, 125, 284 P.3d 251 (2012). Yet, as noted by the Court of Appeals, appellate courts
have a duty to question appellate jurisdiction sua sponte. Ryser v. State, 295 Kan. 452,
456, 284 P.3d 337 (2012). Our review of the proceedings in this case reveals a tangled
web of procedural and jurisdictional issues which have not been adequately briefed or
addressed by either party or fully considered by the panel below. As the State originally
appealed the use of the prior uncounseled DUI diversion on alternate jurisdictional
grounds, we elect to consider this appeal as a question reserved of statewide importance
under K.S.A. 2014 Supp. 22-3602(b)(3), rather than an appeal from an illegal sentence
under K.S.A. 22-3504, cognizant that our review will have no effect on Tims' sentence.
See State v. Berreth, 294 Kan. 98, 123, 273 P.3d 752 (2012) ("an appellate court's answer
                                              6
to a State's question reserved has no effect on the criminal defendant in the underlying
case").


            CONSTITUTIONAL RIGHT TO COUNSEL IN DUI DIVERSION PROCEEDINGS


          In his petition for review, Tims argues that the Court of Appeals erred in
determining that he did not have Sixth Amendment right to be represented by counsel
when he entered into the 2002 DUI diversion agreement with the Topeka city prosecutor.
As noted above, this conclusion led the Court of Appeals to hold that the diversion could
be counted as a prior conviction for purposes of enhancing Tims' sentence for his current
felony third DUI conviction without violating his constitutional rights.


          Whether Tims had a constitutional right to counsel during the 2002 diversion
proceedings raises a question of law subject to unlimited review. See State v. Jones, 290
Kan. 373, 376, 228 P.3d 394 (2010) (stating that the extent of the right to counsel is a
question of law over which this court exercises unlimited review).


          Based on the United States Supreme Court's holding in Alabama v. Shelton, 535
U.S. 654, 658, 122 S. Ct. 1764, 152 L. Ed. 2d 888 (2002), this court in State v.
Youngblood, 288 Kan. 659, Syl. ¶ 2, 206 P.3d 518 (2009), held:


                  "A person accused of a misdemeanor has a Sixth Amendment right to counsel if
          the sentence to be imposed upon conviction includes a term of imprisonment, even if the
          jail time is suspended or conditioned upon a term of probation. The right to counsel arises
          at the stage of the proceedings where guilt is adjudicated, eligibility for imprisonment is
          established, and the prison sentence determined."


          Further, we held in Youngblood that an uncounseled misdemeanor conviction
obtained in violation of a defendant's Sixth Amendment right to counsel (i.e., an
                                                       7
uncounseled conviction that resulted in a prison sentence, even if the sentence was
suspended or conditioned upon a term of probation) "may not be collaterally used for
sentence enhancement in a subsequent criminal proceeding." 288 Kan. 659, Syl. ¶ 3.
Conversely, an uncounseled misdemeanor conviction that resulted in no prison sentence
being imposed may be used to enhance punishment for a subsequent conviction without
violating the Sixth Amendment. Nichols v. United States, 511 U.S. 738, 748-49, 114 S.
Ct. 1921, 128 L. Ed. 2d 745 (1994); Youngblood, 288 Kan. at 667 ("[W]hile a
constitutionally obtained uncounseled misdemeanor conviction can be used to enhance a
subsequent sentence, an unconstitutionally obtained uncounseled misdemeanor
conviction cannot be used for that collateral purpose.").


       K.S.A. 2011 Supp. 8-1567, the statute governing Tims' present DUI offense, is a
recidivist statute providing for an enhanced severity in charge and sentence if the
offender has previous DUI convictions. The statute states that a third conviction for DUI
is a nonperson felony "if the person has a prior conviction which occurred within the
preceding 10 years, not including any period of incarceration." K.S.A. 2011 Supp. 8-
1567(b)(1)(D). Subsection (j) of the DUI statute states that a DUI diversion agreement
entered in lieu of further criminal proceedings is considered a prior DUI conviction for
purposes of determining the classification and sentence of a current DUI conviction.
K.S.A. 2011 Supp. 8-1567(j).


       Based on the above, determining whether an uncounseled DUI diversion can be
constitutionally used to enhance punishment for a subsequent DUI conviction depends on
whether the diversion should be considered the same as an uncounseled misdemeanor
conviction that resulted in a term of imprisonment—suspended or otherwise. If the two
are the same, then, unless the defendant properly waived his constitutional right to
counsel, the diversion cannot be used to enhance punishment for a subsequent DUI
conviction. See Youngblood, 288 Kan. 659, Syl. ¶ 3. If, however, an uncounseled
                                             8
diversion is more similar to an uncounseled misdemeanor conviction that resulted in no
prison sentence being imposed, then the diversion can be constitutionally used to enhance
punishment for a subsequent DUI conviction. See Nichols, 511 U.S. at 748-49;
Youngblood, 288 Kan. at 667.


       According to Tims' diversion agreement, he committed the underlying DUI on
July 24, 2002. Then and now, a city attorney has the discretion to offer a first time DUI
offender a diversion in lieu of further criminal proceedings. Under a diversion agreement,
an offender must waive certain constitutional and statutory rights and agree to abide by
certain conditions; a diversion agreement, however, may not be conditioned on the
defendant entering a plea to the offense charged. If defendant abides by all the terms of
the agreement, the city attorney will dismiss the charge with prejudice. K.S.A. 12-
4414(a); K.S.A. 12-4415; K.S.A. 12-4416. Thus, satisfying a diversion agreement is a
means to avoid a formal judgment of criminal guilt. Petty v. City of El Dorado, 270 Kan.
847, 852, 19 P.3d 167 (2001); see K.S.A. 12-4413(c) and (d). If the defendant fails to
fulfill the terms of the diversion agreement (as determined at a hearing before the
municipal court), then the diversion agreement is revoked and criminal proceedings are
resumed. K.S.A. 12-4418. Specific to diversion agreements on DUI charges, the


       "agreement shall include a stipulation, agreed to by the defendant and the city attorney, of
       the facts upon which the charge is based and a provision that if the defendant fails to
       fulfill the terms of the specific diversion agreement and the criminal proceedings on the
       complaint are resumed, the proceedings, including any proceedings on appeal, shall be
       conducted on the record of the stipulation of facts relating to the complaint." K.S.A. 12-
       4416(b).


       Tims argues that his DUI diversion is essentially the same as a suspended sentence
for an uncounseled misdemeanor conviction as contemplated in Shelton and Youngblood.
He maintains that the diversion agreement could have resulted in his imprisonment had
                                                    9
the agreement been revoked and had he been sentenced to a jail term as a first-time DUI
offender. We are unconvinced. Tims' argument ignores a crucial distinction between a
diversion agreement and a suspended sentence or probation: at the time a defendant
enters into a diversion agreement, no formal adjudication of guilt is entered, eligibility for
imprisonment is not established, and no prison sentence is imposed. See Youngblood, 288
Kan. 659, Syl. ¶ 2 ("The right to counsel arises at the stage of the proceedings where guilt
is adjudicated, eligibility for imprisonment is established, and the prison sentence
determined."). Though a diversion is considered a prior conviction pursuant to K.S.A.
2011 Supp. 8-1567(j), the diversion does not have an underlying sentence attached to it
and, thus, is distinguishable from a misdemeanor conviction resulting in a suspended jail
sentence. An uncounseled diversion is more analogous to an uncounseled misdemeanor
conviction that did not result in any jail sentence. As noted above, such a conviction is
valid under the Sixth Amendment and can be used to enhance a sentence in a subsequent
criminal proceeding.


          Notwithstanding the fact that Tims may have been vulnerable to imprisonment had
his diversion been revoked and had he been convicted of the underlying DUI offense, see
K.S.A. 2002 Supp. 8-1567(d) (sentence for first-time DUI offender is "not less than 48
consecutive hours nor more than six months' imprisonment, or in the court's discretion
100 hours of public service" [Emphasis added.]), his Sixth Amendment right to counsel
never attached during the diversion proceedings because the proceedings did not result in
an actual or suspended term of imprisonment being imposed. Consequently, the 2002
diversion can be considered as a prior conviction without violating Tims' constitutional
rights.




                                             10
               STATUTORY RIGHT TO COUNSEL IN DUI DIVERSION PROCEEDINGS


       As just noted, the Court of Appeals concluded that though Tims' constitutional
right to counsel did not attach during the 2002 diversion proceedings, he did have a
statutory right to counsel during the proceedings. The applicable statute, K.S.A. 12-
4414(c), states in pertinent part: "[T]he defendant shall be present and shall have the
right to be represented by counsel at the diversion conference with the city attorney."
(Emphasis added.)


       In construing this statutory language, the Court of Appeals in Paletta v. City of
Topeka, 20 Kan. App. 2d 859, 866, 893 P.2d 280, rev. denied 258 Kan. 895 (1995),
stated: "There is no statutory requirement in this state mandating that a defendant have
counsel to enter into a misdemeanor diversion agreement." The panel in Paletta further
opined: "This statutory provision does not mandate that counsel be provided for a
defendant nor void any diversion agreement entered into without counsel." 20 Kan. App.
2d at 866.


       In commenting about the Paletta's interpretation of K.S.A. 12-4414(c), the panel
here stated:


                "We mostly agree with the Paletta panel's conclusions as to the nature of this
       statutory right. First, we agree that a defendant is not required to have counsel in order to
       enter into a valid diversion agreement as that right may be knowingly and voluntarily
       waived. K.S.A. 2012 Supp. 22-2909(a); K.S.A. 2012 Supp. 12-4416(a). Second, we agree
       that this statutory right to counsel does not mandate that counsel be provided because any
       Kansas statute requiring counsel and requiring the appointment of counsel in case of the
       defendant's indigence specifically says so. See, e.g., K.S.A. 12-4405 (some municipal
       cases); K.S.A. 22-2805(b) (material witness in custody); K.S.A. 22-3104(1) (counsel for
       inquisition witness); K.S.A. 2012 Supp. 22-3428a(2) (annual hearing for committed

                                                    11
         mentally ill person); K.S.A. 2012 Supp. 22-3716(b) (probation revocation hearing);
         K.S.A. 22-4503(a) and (b) (felony cases); K.S.A. 2012 Supp. 38-2205 (parents in CINC
         case); K.S.A. 2012 Supp. 59-29a06(b) (sexual predator commitment proceeding); K.S.A.
         59-3063 (proposed ward); K.S.A. 2012 Supp. 65-129c(d)(10) (health official ordered
         isolation or quarantine); see also Supreme Court Rule 183(i) (2013 Kan. Ct. R. Annot.
         278) (right to counsel in K.S.A. 60-1507 proceeding where motion presents substantial
         question of law or triable issue of fact). Third, we express no view as to whether an
         uncounseled diversion is void in the absence of a valid waiver but would certainly agree
         that a diversion agreement is not void where there has been a knowing and voluntary
         waiver of counsel." Tims, 49 Kan. App. 2d at 855-56.


         The panel then proceeded to determine whether Tims had validly waived his
statutory right to counsel when he entered into the diversion agreement. After reviewing
this court's decisions in State v. Hughes, 290 Kan. 159, 224 P.3d 1149 (2010), and In re
Habeas Corpus Application of Gilchrist, 238 Kan. 202, 708 P.2d 977 (1985), the panel
concluded that the language within the diversion agreement established that Tims
knowingly and voluntarily waived his statutory right to counsel. The panel then held that
the 2002 diversion could be counted as a prior DUI conviction for sentencing purposes
without running afoul of Tims' statutory right to counsel. Tims, 49 Kan. App. 2d at 856-
58.


         Tims argues that Hughes and Gilchrist mandate that before a defendant can validly
waive his or her right to counsel and enter into a diversion agreement, a judge must have
fully advised the defendant of his or her right to counsel. Furthermore, Tims argues that
the two cases require language within the diversion agreement certifying that the judge
fully advised the defendant of his or her right to counsel and that the defendant, after
receiving this information, knowingly and voluntarily waived that right in front of the
judge.



                                                     12
       Both Hughes and Gilchrist involved uncounseled municipal court convictions that
resulted in jail sentences being imposed. Thus, the issue in both cases was whether those
convictions were constitutionally valid, i.e., whether the defendants had properly waived
their Sixth Amendment right to counsel prior to being convicted and sentenced to jail.
Hughes, 290 Kan. at 160, 162-64, Gilchrist, 238 Kan. at 203, 206-07. As already
determined, Tims' Sixth Amendment right to counsel was not implicated by the 2002
diversion proceedings. Consequently, the certification language and procedure suggested
by Hughes and Gilchrist to ensure that a municipal court judge properly advises a
defendant of his or her right to counsel is not a requirement for a valid diversion
agreement. As the panel in this case noted, any waiver of the statutory right to counsel
"must simply be done knowingly and voluntarily." Tims, 49 Kan. App. 2d at 857. Thus,
the language of the diversion agreement controls appellate review of the soundness of the
waiver.


       This court has held that diversion agreements are to be interpreted in accordance
with contract principles. State v. Chamberlain, 280 Kan. 241, 245-46, 120 P.3d 319
(2005). An appellate court exercises unlimited review over the interpretation and legal
effect of written instruments. Prairie Land Elec. Co-op v. Kansas Elec. Power Coop, 299
Kan. 360, 366, 323 P.3d 1270 (2014). "The primary rule for interpreting written contracts
is to ascertain the parties' intent. If the terms of the contract are clear, the intent of the
parties is to be determined from the language of the contract without applying rules of
construction." Anderson v. Dillard's, Inc., 283 Kan. 432, 436, 153 P.3d 550 (2007).


       The text of the diversion agreement states in pertinent part:


               "This agreement is voluntarily entered into by the above-named defendant and
       the Office of the City Attorney of Topeka, Kansas, in lieu of further prosecution on the
       above charge(s).


                                                   13
               "The defendant understands he/she has the following rights in this case: The
       right to a speedy arraignment; the right to a trial to the Court . . . the right to be
       represented at all stages of this case by a lawyer of his/her own choosing or; if without
       funds with which to hire a lawyer and found by the Court to be indigent, by a court-
       appointed lawyer. Knowing these rights, the defendant by signing this agreement,
       knowingly and voluntarily gives up these rights, including the right to a lawyer if not
       represented by one in this case." (Emphasis added.)


       The diversion agreement notes that Tims was acting pro se when he entered into
the agreement. There is no signature on the line dedicated to "Attorney for Defendant."
The diversion agreement was signed by Tims and by the attorney for the City of Topeka.


       As noted by the panel in this case, Tims raises no argument on appeal challenging
the content of the diversion agreement or the capacity of either party to enter into the
agreement. He merely argues that his waiver of the right to counsel within the diversion
agreement was invalid under Hughes and Gilchrist. However, as we just distinguished,
those cases are inapplicable to determining whether a defendant's waiver of the statutory
right to counsel was knowing and voluntary. Here, the language of the diversion
agreement—which Tims signed—specifically states that after being informed of the
stated rights, including his right to counsel, Tims "knowingly and voluntarily gives up
these rights, including the right to a lawyer if not represented by one in this case." Thus,
based on the clear and unambiguous language of the diversion agreement, it appears that
Tims knowingly and voluntarily waived his right to be represented by an attorney during
the diversion conference.


       Based on the above, we conclude that counting Tims' 2002 diversion as a prior
DUI conviction for purposes of classifying and sentencing him for his current DUI
conviction does not violate his constitutional or statutory right to counsel. Thus, we
affirm the Court of Appeals' decision reversing the district court. However, our
                                                      14
consideration of this issue on question reserved compels us to vacate the order of the
Court of Appeals remanding the case for resentencing as a felony DUI.




                                            15
