
70 P.3d 517 (2002)
The PEOPLE of the State of Colorado, Plaintiff-Appellant,
v.
William Marshall DALTON, Defendant-Appellee.
No. 01CA1624.
Colorado Court of Appeals, Div. V.
November 7, 2002.
Certiorari Denied May 27, 2003.
*518 Jeanne M. Smith, District Attorney, Gordon R. Denison, Deputy District Attorney, Amy Folsom Mullaney, Deputy District Attorney, Sherri R. Gryboski, Deputy District Attorney, Colorado Springs, Colorado, for Plaintiff-Appellant.
*519 David S. Kaplan, Colorado State Public Defender, Shann Jeffery, Deputy State Public Defender, Denver, Colorado, for Defendant-Appellee.
Opinion by Judge TAUBMAN.
The People appeal the trial court's order permitting defendant, William Marshall Dalton, to withdraw his guilty plea. We vacate the order and remand for reinstatement of the judgment of conviction.
The prosecution filed a direct criminal information against defendant in district court in 1998, charging him with sexual assault on a child by one in a position of trust (count one) and sexual assault on a child as part of a pattern of sexual abuse (count two). Count one alleged events occurring from December 1, 1991 to June 1, 1993, and count two alleged events occurring from December 1, 1991 to December 3, 1997. Both counts concerned alleged sexual assaults on the same victim. Defendant was eighteen years old when the charges against him were filed, but a juvenile when the charged offenses occurred.
Defendant entered into a plea bargain under which he pleaded guilty to count one and the prosecution agreed to dismissal of count two. Defendant was sentenced to ten years in the Department of Corrections.
Defendant subsequently filed a postconviction motion to vacate the plea agreement, alleging the district court lacked jurisdiction over count one. Defendant argued that the requirements of the direct filing statute were not satisfied because he was under the age of fourteen during the entire period of that alleged offense. At the hearing on the motion, defense counsel argued that jurisdiction must attach to "all of [the information] or none of it." The trial court agreed and vacated the resulting sentence. The court ordered defendant's plea of guilty withdrawn, reinstated count two, and set a trial date.

I. Appellate Jurisdiction
As a preliminary matter, we address defendant's contention that this court lacks jurisdiction to hear the prosecution's appeal because the trial court's order does not constitute a final judgment. We disagree.
Section 16-12-102(1), C.R.S.2002, provides in pertinent part that "[a]ny order of a court that either dismisses one or more counts of a charging document prior to trial or grants a new trial after the entry of a verdict or judgment shall constitute a final order that shall be immediately appealable." Further, a trial court's order granting a defendant's postconviction motion also constitutes a final, appealable order. Crim. P. 35(c)(3).
Here, although defendant's postconviction motion relied on Crim. P. 12(b)(2), which applies to trial proceedings, the motion is authorized pursuant to Crim. P. 35(c)(2)(III). Therefore, we will consider defendant's motion as a Crim. P. 35(c) motion. See DePineda v. Price, 915 P.2d 1278 (Colo.1996)(habeas corpus petition treated as a Crim. P. 35 motion based on the substantive issues raised, instead of the label of the pleading). As such, the prosecution properly appeals from the trial court's order. See § 16-12-102(1).
Accordingly, the trial court's ruling granting defendant's motion constituted a final judgment, and we have jurisdiction to hear this appeal.

II. Due Process and Ex Post Facto Clauses
In support of the order appealed here, defendant contends the district court also lacked jurisdiction over count two. He argues that applying the direct filing statute in effect in 1997 to him violates the Due Process and Ex Post Facto Clauses of the United States and Colorado Constitutions because the period of the alleged offense included several years before he turned fourteen and was ineligible for direct filing in district court. In addition, defendant argues that the rule of lenity requires application of the least oppressive direct filing statute when the period of a charged offense is subject to different direct filing laws. We reject both arguments.
In 1997, the direct filing statute provided in pertinent part:
A juvenile may be charged by the direct filing of an information in the district court or by indictment only when:

*520 ...
(II) The juvenile is fourteen years of age or older and:
(A) Is alleged to have committed a felony enumerated as a crime of violence pursuant to section 16-11-309 [now § 18-1.3-406], C.R.S.....
Colo. Sess. Laws 1996, ch. 283, § 19-2-517 at 1640 (now codified with amendments as Section 19-2-517(1)(a), C.R.S.2002). Because sexual assault on a child is a crime of violence, this direct filing statute applied to defendant. In contrast, the version of the statute in effect until July 1993 provided different criteria for direct filing, and those criteria did not apply to defendant.

A. Due Process and Ex Post Facto Violations
Defendant first contends that applying the direct filing statute in effect in 1997 to him constitutes an impermissible retroactive application. We disagree.

1. Due Process
"Retroactive application of a procedural rule may violate due process if the judicial action enlarges the scope of a criminal statute so as to define previously lawful behavior as criminal or if the procedural changes impair the defendant's substantial rights." People v. Benney, 757 P.2d 1078, 1081 (Colo.App.1987) (citation omitted). The direct filing statute provides a procedural mechanism whereby juveniles may be charged as adults if the statutory criteria are satisfied. See Myers v. District Court, 184 Colo. 81, 518 P.2d 836 (1974) (interpreting Colo. Sess. Law 1973, ch. 110, § 22-1-4 at 385, the predecessor to § 19-2-517(1)(a)).
Here, defendant contends that his substantial rights were impaired because he would have been ineligible for direct filing during the period alleged in count one, yet he was eligible as of 1997. Defendant relies on the fact that sexual assault committed as part of a pattern of sexual abuse, as charged in count two, is a sentence enhancement provision, which increases the felony classification. People v. Whitley, 998 P.2d 31, 33 (Colo.App. 1999); People v. Bowring, 902 P.2d 911, 915-16 (Colo.App.1995). He argues that the date for establishing jurisdiction for count two therefore is the alleged date of completion of count two, December 3, 1997. He further asserts that the prosecution asserted in both briefs and oral argument that the predicate act for count two occurred sometime during the December 1991 to June 1993 period alleged in count one. Thus, his argument goes, the direct filing statute in effect in 1997 cannot be retroactively applied to him to confer jurisdiction on the district court.
On the contrary, the information alleged only that the dates of the pattern conduct spanned the entire period alleged in count two. In fact, count two did not allege specific dates for either the predicate act or the pattern conduct. See Colo. Sess. Laws 1995, ch. 240, § 18-3-405(2)(d) at 1252 (now codified with amendments as § 18-3-405(2)(d), C.R.S.2002)(the pattern of sexual abuse charge need not include a specific date or time except that the pattern acts must have been committed "within ten years prior to the offense charged in the information or indictment").
Because the direct filing statute in effect in 1997 did not define previously lawful behavior as criminal or impair defendant's substantive rights, its application did not violate his right to due process. Here, the direct filing statute in effect in 1997 does not define previously lawful behavior as criminal, but instead enumerates the requirements for a juvenile to be tried as an adult. Further, the procedural changes did not impair defendant's substantial rights because there is no fundamental right to be treated as a juvenile in a criminal case, People v. Hughes, 946 P.2d 509, 514 (Colo.App.1997), overruled on other grounds by Valdez v. People, 966 P.2d 587 (Colo.1998), and the statute merely establishes in which court defendant could be tried.

2. Ex Post Facto Clause
"When a law either imposes punishment for an act that was not a crime when it was committed or makes the punishment for a crime more onerous than the punishment when the crime was committed, it violates the constitutional prohibitions against ex post *521 facto laws." People v. Luman, 994 P.2d 432, 436 (Colo.App.1999).
However, a statute is not rendered unconstitutional as an ex post facto law merely because some of the facts upon which it operates occurred before the adoption of the statute. People v. Bastian, 981 P.2d 203 (Colo.App.1998).
The critical question in an ex post facto analysis is whether a statutory amendment changes the legal consequences of acts completed before the effective date of the relevant statute. Where some of the elements of an offense are committed before the effective date of a new statute, but the crime is not completed until after the new statute's effective date, application of the new statute does not violate the Ex Post Facto Clause. See People v. Bastian, supra, 981 P.2d at 206.
The circumstances here are similar to those in People v. Bowring, 902 P.2d 911 (Colo.App.1995), where a division of this court held that even though one of the incidents relied on by the prosecution to prove pattern sexual assault may have occurred before the effective date of the statute, there was no ex post facto violation. Cf. People v. Graham, 876 P.2d 68 (Colo.App.1994)(ex post facto violation present in pattern sexual assault prosecution where verdict requiring an enhanced sentence could have been based on an act which preceded passage of the statute in question).
Here, the direct filing statute in effect in 1997 merely applied a procedural mechanismthe direct filing statuteto some facts occurring before its adoption. Since the pattern alleged in count two was not completed until after the effective date of the 1997 amendment to the direct filing statute, there was no ex post facto violation. People v. Bastian, supra.
Thus, we reject defendant's argument that the district court lacked jurisdiction of count two.

B. Rule of Lenity
Defendant also argues that application of the 1997 direct filing statute violates the rule of lenity. Again, we disagree.
The rule of lenity applies when a statute is ambiguous; it does not require a court to show leniency. People v. Flagg, 18 P.3d 792, 795 (Colo.App.2000).
Here, defendant contends that there is ambiguity as to which version of the direct filing statute applies to him. We have previously concluded that the direct filing statute in effect in 1997 applies to defendant. That statute is not ambiguous.
Accordingly, we conclude the rule of lenity does not apply.

III. Ancillary Jurisdiction
The People contend the trial court erred in finding that it lacked jurisdiction to accept a plea of guilty to count one, which did not independently authorize direct filing, after it dismissed count two, which authorized direct filing. The People concede that count one did not independently provide the district court with jurisdiction over defendant, but maintain the court had ancillary jurisdiction over count one because it indisputably had jurisdiction under count two. We agree.
Where an appellant raises questions of law on appeal, the trial court's ruling is reviewed de novo. People v. Melillo, 25 P.3d 769, 777 (Colo.2001).
No Colorado appellate decision has addressed the doctrine of ancillary jurisdiction in criminal cases. However, a division of this court addressed a similar situation in People v. Hughes, supra, where the defendant was acquitted of the charge that authorized the direct filing, but was convicted of charges that would not independently have given the district court subject matter jurisdiction. The Hughes division concluded that, with respect to direct filing, the district court's subject matter jurisdiction is triggered by the seriousness of the charges, not by any resulting conviction therefrom. People v. Hughes, supra, 946 P.2d at 513; see also A.C. v. People, 16 P.3d 240, 242 (Colo. 2001)("the legislature has chosen to permit a juvenile to be charged, tried and sentenced as an adult under circumstances where the severity of the crime mandates it").
*522 Here, while defendant disputes the applicability of the direct filing statute in effect in 1997, it is undisputed that the crime charged in count two required sentencing under the crime of violence statute. Therefore, the trial court had jurisdiction over that count under the direct filing statute.
It follows that the district court had ancillary jurisdiction over count one because it had jurisdiction over count two, a crime mandating sentencing under the crime of violence statute. This conclusion is consistent with Commonwealth v. Archer, 722 A.2d 203, 206 n. 8 (Pa.Super.Ct.1998), where the prosecution directly filed murder charges, among others, against a juvenile defendant in adult criminal court, and he was acquitted of murder. The court concluded, "When murder charges are filed against a minor in adult court, the court has jurisdiction over other charges filed and arising from the same criminal transaction." See also Jensen v. State, 328 Ark. 349, 352, 944 S.W.2d 820, 821 (1997) ("Jurisdiction is determined from the pleadings. Subject-matter jurisdiction `is tested on the pleadings and not the proof.' The General Assembly has not based court assignment in juvenile cases upon the nature of the offense `committed' but upon that which is charged." (citations omitted)).
Our conclusion that the district court had ancillary jurisdiction to hear the charges in count one also is supported by the rule of mandatory joinder. See Marquez v. County Court, 719 P.2d 737 (Colo.App.1986)(misdemeanor and traffic charges should not be tried separately in county and district courts because the juvenile court had jurisdiction to consider both charges under the mandatory joinder statute). The mandatory joinder statute requires joinder of multiple offenses in a single prosecution "if they are based on the same act or series of acts arising from the same criminal episode." Section 18-1-408(2), C.R.S.2002.
"`[A] series of acts arising from the same criminal episode' would include physical acts that are committed simultaneously or in close sequence, that occur in the same place or closely related places, and that form part of a schematic whole." People v. Jones, 967 P.2d 166, 169 (Colo.App.1997).
In light of the mandatory joinder statute, both parties agree that counts one and two should be tried together, but disagree in which court defendant should be tried. Defendant contends the charges should be tried in juvenile court, while the prosecution argues both counts should be tried in district court. Defendant asserts that the rule of mandatory joinder does not confer jurisdiction on the district court because count two did not indicate when the predicate act occurred and therefore both the predicate and prior sexual assaults could have occurred during the same time frame as count one. However, both counts were based on the same act or series of acts stemming from the same criminal episode, even though the criminal episode was alleged to have occurred over different periods of time.
We recognize the competing policy considerations expressed in the Children's Code. On the one hand, the General Assembly intended that certain charges against a juvenile be heard in juvenile court, and it provided that court with exclusive jurisdiction. Section 19-1-104(1)(a), C.R.S.2002. On the other hand, a contrary intent is evidenced by the direct filing mechanism in the Children's Code, which allows juveniles to be tried as adults. Section 19-2-517, C.R.S. 2002. In balancing these policy considerations, we conclude that the prevailing legislative intent is that all charges involving a minor be resolved in adult court when the requirements of the direct filing statute are satisfied as to any charge. To conclude otherwise would frustrate the policy that allows certain offenses to be resolved in adult criminal court based on the seriousness of the offenses involved where a juvenile defendant is charged with several offenses, not all of which qualify for direct filing in district court.

IV. Continuing Jurisdiction
The People further contend that once the district court had jurisdiction over count two, its jurisdiction continued until final disposition of the case, even after count two was dismissed as part of the plea bargain. We agree.
"Once charges are directly filed in district court against a juvenile which include and *523 are based on allegations of a crime of violence, the sentencing of that juvenile for any conviction resulting from those charges must be done by the district court." People v. Hughes, supra, 946 P.2d at 513.
A defendant admits wrongdoing by pleading guilty. "After the court accepts a knowing and voluntary plea, `nothing remains but to give judgment and determine punishment.'" People v. Schneider, 25 P.3d 755, 760 (Colo.2001)(quoting Boykin v. Alabama, 395 U.S. 238, 242, 89 S.Ct. 1709, 1711-12, 23 L.Ed.2d 274, 279 (1969)).
Here, defendant's guilty plea was the functional equivalent of a conviction on count one. As in People v. Hughes, supra, the district court was required to sentence defendant because the charges against him included a crime of violence.
Because the district court had jurisdiction over the crime of violence in count two and it had ancillary jurisdiction over count one, we conclude the court's jurisdiction continued until the final disposition, and the district court was required to sentence defendant for any conviction resulting from the charges filed against him.
The trial court's order is vacated, and the case is remanded for reinstatement of the judgment of conviction.
Judge ROTHENBERG and Judge WEBB concur.
