
3 Kan. App. 2d 726 (1979)
602 P.2d 99
In the Matter of the Application of ROBERT M. BERKOWITZ for a Writ of Habeas Corpus.
No. 50,753
Court of Appeals of Kansas.
Opinion filed October 26, 1979.
Jack Focht, of Smith, Shay, Farmer and Wetta, of Wichita, for the petitioner.
William Rex Lorson, county attorney, and Robert T. Stephan, attorney general, for the respondent.
Before FOTH, C.J., ABBOTT and REES, JJ.
FOTH, C.J.:
This is an original proceeding in habeas corpus. Petitioner Robert M. Berkowitz stands charged in the district court of Saline County with two counts of abuse of a child. He contends that his present custody by the respondent sheriff is unlawful because trial on the pending charges would subject him to double jeopardy.[1] The case presents a profound conflict between two important interests of our society: on the one hand that *728 malefactors not escape their just deserts; and on the other that its individual members not have to "run the gantlet" of trial and potential punishment more than once for the same offense.
Petitioner was originally charged in November, 1975, with the aggravated battery of Golda Smolin. Golda was the ten-month-old daughter of Margaret Smolin, with whom petitioner was living at that time. Margaret Smolin was also charged with aggravated battery. She was separately tried, and convicted as an aider and abettor of a principal who was presumably the petitioner Berkowitz.
Her conviction was affirmed in State v. Smolin, 221 Kan. 149, 557 P.2d 1241 (1976). The opinion in that case contains a description of the factual basis for the charges against both Margaret and Berkowitz. For our purposes it is enough to note that there was alleged a pattern of severe mistreatment of the infant Golda over a period extending from at least July 17 through July 26, 1975.
As stated, petitioner was separately tried for aggravated battery as defined in K.S.A. 21-3414. Over his objection the jury was instructed on criminal injury to persons under K.S.A. 21-3431 as a lesser included offense. The jury convicted him of the lesser offense, and he appealed to the Supreme Court.
While that appeal was pending the Supreme Court decided State v. Kirby, 222 Kan. 1, 563 P.2d 408 (1977), holding the criminal injury to persons statute (21-3431) to be unconstitutionally vague and therefore void. The State thereupon filed a confession of error in petitioner's case, since it was obvious his conviction under a void statute could not stand. On July 25, 1977, the Supreme Court entered its order:
"Upon confession of error by the Appellee, the Appellant's conviction, judgment and sentence is vacated and the Appellant is discharged with costs charged to the Appellee."
In the meantime, substantially simultaneously with the filing of its confession of error, the State filed new charges against petitioner in Saline County. The complaint was originally in three counts, all charging abuse of a child under K.S.A. 21-3609. One was dismissed by the State and after a preliminary examination petitioner was bound over for trial on the presently pending two counts. One charges abuse of Golda Smolin between July 15 and July 18, 1975; the other, abuse of the same child on July 25, 1975.
*729 Prior to his arraignment petitioner filed a motion to dismiss, raising the defense of double jeopardy. The motion was overruled and petitioner attempted to appeal to this court. On motion of the State we dismissed the appeal on August 24, 1978. The Supreme Court denied review of our order on November 8, 1978. Petitioner thereafter commenced this proceeding. Pursuant to Rule No. 9.01 (a), 224 Kan. xlix, this court determined that the district court's prior denial of relief was sufficient reason why the action should be brought in an appellate court. Accordingly, we stayed the impending trial and directed a response by the State, called for briefs, and heard oral argument.
I.
Our dismissal of petitioner's appeal from the order denying his pretrial motion to dismiss was for lack of jurisdiction based on State v. Fisher, 2 Kan. App.2d 353, 579 P.2d 167, rev. denied 225 Kan. 846 (1978). That case held that a pretrial denial of a claim of double jeopardy could not be separately appealed under Kansas statutes and Kansas case law, including State v. Hickerson, 184 Kan. 483, 337 P.2d 706 (1959) and State v. Wallace, 172 Kan. 734, 243 P.2d 216 (1952). Appellate review is available only after trial and conviction, on appeal from the final judgment against the defendant.
In Fisher the court discussed at some length Abney v. United States, 431 U.S. 651, 52 L.Ed.2d 651, 97 S.Ct. 2034 (1977). In Abney the Court held that a pretrial order denying a claim of double jeopardy was a "final decision" on that issue within the meaning of the federal statute permitting appeals only from final decisions. The Court there applied the federal "collateral order" doctrine because, among other reasons, to deny appellate review until after the trial would be to deny a substantial element of the constitutional right. As the Abney Court put it:
"To be sure, the Double Jeopardy Clause protects an individual against being twice convicted for the same crime, and that aspect of the right can be fully vindicated on an appeal following final judgment, as the Government suggests. However, this Court has long recognized that the Double Jeopardy Clause protects an individual against more than being subjected to double punishments. It is a guarantee against being twice put to trial for the same offense." 431 U.S. 660-61. Emphasis in original.
In Fisher this court dismissed the appeal "with considerable reluctance," implicitly inviting our own Supreme Court to adopt a construction of our statutory term "judgment" similar to the *730 federal construction of "final order." By its denial of review our court declined the invitation. The result is that unless habeas corpus is available a defendant would have no appellate forum available in the Kansas courts to vindicate a valid double jeopardy claim before he is in fact subjected to such jeopardy. Under those circumstances the federal courts would reluctantly but unhesitatingly step in to fill the void.[2]
Previous Kansas case law, though scarce, indicates that habeas corpus is a proper vehicle to raise the defense of double jeopardy. In Kamen v. Gray, 169 Kan. 664, 220 P.2d 160 (1950), defendant's first trial ended in a mistrial and he was recharged. Defendant then filed a writ of habeas corpus, raising the double jeopardy issue. On appeal, the propriety of habeas corpus in such circumstances was discussed:
"The state contends that habeas corpus did not lie in this case for the reason that petitioner's cause is still pending and undetermined in the lower court. However, this court held many years ago that if the petitioner was entitled to his discharge in the district court, he ought to be released in his proceeding by habeas corpus, as that proceeding is the only one which affords him a speedy remedy. If his only remedy is by appeal, he must continue wrongfully restrained of his liberty until the case is finally determined by the district court, as an appeal can be taken by the defendant only after judgment. It would be a palpable violation of the bill of rights, and also of the statute, to require an accused who is entitled to his discharge, so far as relates to the offense for which he was committed, to be restrained of his liberty indefinitely at the instance of the state, or upon the order of the court, to await a final trial, or determination of the case against him." 169 Kan. at 669. Emphasis added.
Although that is the only case we find in which the issue is discussed, the remedy was apparently assumed to be available in In re Christensen, 166 Kan. 671, 203 P.2d 258 (1949); Struble v. Gnadt, 164 Kan. 587, 191 P.2d 179 (1948); Claflin v. State, 154 Kan. 452, 119 P.2d 540 (1941); and In re Lewis, 152 Kan. 193, 102 P.2d 981 (1940).
We therefore conclude that habeas corpus is an appropriate vehicle for challenging a trial court's pretrial denial of a claim of double jeopardy. Where, as here, the facts are not in dispute or may be determined from transcripts or other evidence in written form, an appellate court may be a proper forum in the first instance. If testimony is required, the district court is the place to start, with an appeal to this court if necessary, even though a *731 judge of that court may have already overruled a motion to dismiss.
II.
The State suggests that petitioner waived the defense of double jeopardy by failing to raise it at his preliminary examination, but instead waiting until just before his arraignment. It relies on Cox v. State, 197 Kan. 395, 416 P.2d 741 (1966). The Court there observed that double jeopardy is an affirmative defense which is waived if not asserted in a timely fashion. See discussion and cases cited in 197 Kan. at 402. It held that by his action and inaction Cox waived the defense because the principle of waiver is applicable "when a defendant on arraignment not only fails to affirmatively interpose a defense of former jeopardy but voluntarily requests leave to withdraw a plea of not guilty and enters a plea of guilty to a lesser included offense." 197 Kan. at 403. Thus, even under Cox the soonest that a waiver could be found was at arraignment.
Under our present Code of Criminal Procedure the time is even later. Clearly the defense need not be interposed at the preliminary examination; K.S.A. 1978 Supp. 22-2902(3) provides that "[t]he defendant shall not enter a plea at the preliminary examination." Instead, pretrial motions are governed by K.S.A. 22-3208. That statute requires that defenses not going to the merits be raised by motion  generally a motion to dismiss. Subsection (4) provides:
"(4) The motion to dismiss shall be made at any time prior to arraignment or within 20 days after the plea is entered. ... A plea of guilty or a consent to trial upon a complaint, information or indictment shall constitute a waiver of defenses and objections based upon the institution of the prosecution or defects in the complaint, information or indictment other than it fails to show jurisdiction in the court or to charge a crime." Emphasis added.
Under subsection (5) the motion is generally to be determined before trial, and under (6), "If a motion is determined adversely to the defendant he shall then plead if he had not previously pleaded. A plea previously entered shall stand."
As we read the statutes there is no waiver unless the defendant pleads guilty, or unless he consents to go to trial without raising an available defense based on the institution of the prosecution. Here the motion to dismiss was made before arraignment; under 22-3208(4) he could have waited until twenty days after, so long as that was still before trial. We conclude there was no waiver.
*732 III.
Perhaps the most difficult question presented by this case is whether petitioner has been in jeopardy at all. In resolving that question we must first recognize that he went to trial on only one count, that of aggravated battery. He was convicted of what was then conceived to be a lesser included offense  criminal injury to persons  but which later turned out to be no offense at all. The question is the effect of this previous abortive prosecution.
As to the aggravated battery charge our statute on multiple prosecutions, K.S.A. (now 1978 Supp.) 21-3108, gives us the answer. The last sentence of subsection (1) provides:
"A conviction of an included offense is an acquittal of the offense charged."
In addition, subsection (5) provides:
"In no case where a conviction for a lesser included crime has been invalidated, set aside, reversed or vacated shall the defendant be subsequently prosecuted for a higher degree of the crime for which such defendant was originally convicted."
Together the two provisions codify the Fifth Amendment double jeopardy rule of Green v. United States, 355 U.S. 184, 2 L.Ed.2d 199, 78 S.Ct. 221 (1957). Although that rule was not applicable to the states at the time 21-3108 was drafted as part of the new Kansas Criminal Code, it was shortly thereafter made so through the Fourteenth Amendment in Benton v. Maryland, 395 U.S. 784, 23 L.Ed.2d 707, 89 S.Ct. 2056 (1969).
The problem of the invalid conviction will be considered later. What is clear from the statute and from Benton is that the jury verdict in the original trial acquitted petitioner of aggravated battery, the only crime with which he was charged.
IV.
It has been said that "[t]here has been enough written about double jeopardy to satisfy the most avid scholar." Schaefer, Unresolved Issues in the Law of Double Jeopardy: Waller and Ashe, 58 Calif. L. Rev. 391 (1970). Nevertheless, because the position of Kansas in the forefront of the jurisdictions attempting to make the guaranty meaningful may not be fully recognized, it seems appropriate to review briefly the present state of our law and how we arrived at it.
A. The Federal Rule. Until now we have been discussing double jeopardy in a federal constitutional sense. To date the United States Supreme Court has recognized two aspects of *733 double jeopardy under the Fifth Amendment. The first is the "same evidence" or "identity of elements" test  the so-called Wharton Rule  most recently exemplified by Brown v. Ohio, 432 U.S. 161, 166, 53 L.Ed.2d 187, 97 S.Ct. 2221 (1977):
"The established test for determining whether two offenses are sufficiently distinguishable to permit the imposition of cumulative punishment was stated in Blockburger v. United States, 284 U.S. 299, 304 [76 L.Ed. 306, 52 S.Ct. 180] (1932):
"`The applicable rule is that where the same act or transaction constitutes a violation of two distinct statutory provisions, the test to be applied to determine whether there are two offenses or only one, is whether each provision requires proof of a fact which the other does not....'
"This test emphasizes the elements of the two crimes. `If each requires proof of a fact that the other does not, the Blockburger test is satisfied, notwithstanding a substantial overlap in the proof offered to establish the crimes....' Iannelli v. United States, 420 U.S. 770, 785 n. 17 [43 L.Ed.2d 616, 95 S.Ct. 1284] (1975)."
Under this test a defendant may be separately punished for a number of crimes, even though arising out of the same transaction, so long as each has at least one statutory element not required to prove the others. In addition, the defendant may be separately tried for each separate offense, even though related, so long as at each trial evidence is required which is not required in the others.
The second aspect of the federal guaranty is the "collateral estoppel" doctrine espoused in Ashe v. Swenson, 397 U.S. 436, 25 L.Ed.2d 469, 90 S.Ct. 1189 (1970). Under that doctrine an issue necessarily determined in the defendant's favor in one prosecution may not be relitigated in a later one. Thus in Ashe an acquittal of a charge of robbing one of six participants in a poker game established that the accused was not a participant in the robbery and precluded a later prosecution for robbing the other victims. This despite the fact that under the "same evidence" test it would have been proper to try, convict and punish the defendant separately for each of the six robberies.
The limitations of these two doctrines are apparent. The same evidence rule permits repeated prosecutions with their attendant delay, expense and anxiety, so long as the crimes are distinct. The collateral estoppel rule requires an often fruitless inquiry into just which issues were resolved by the general verdict of the jury.
Recognition of these limitations has led to considerable agitation in both judicial and scholastic circles for the inclusion in the *734 federal rule of the doctrine of "compulsory joinder," under which all crimes of which evidence will be offered, or at least all arising out of a single act, episode or "transaction," must be joined in one prosecution. See Schaefer (then Justice of the Illinois Supreme Court), Unresolved Issues in the Law of Double Jeopardy: Waller and Ashe, 58 Calif. L. Rev. 391 (1970); Note, Double Jeopardy: Multiple Prosecutions Arising from the Same Transaction, 15 Am. Crim. L. Rev. 259 (1978); Ashe v. Swenson: Criminal Law  Double Jeopardy  Collateral Estoppel, 48 Den. L.J. 130 (1971); Note, Ashe v. Swenson: Collateral Estoppel is Constitutionally Required in Criminal Cases Because it is Embodied in the Fifth Amendment Double Jeopardy Clause, 69 Mich. L. Rev. 762 (1971); Twice in Jeopardy, 75 Yale L.J. 262 (1965). Brown v. Ohio, 432 U.S. at 170 (Brennan, J., concurring, joined by Marshall, J.); Ashe v. Swenson, 397 U.S. at 453-4 (Brennan, J., concurring, joined by Douglas and Marshall, JJ.); Thompson v. Oklahoma, 429 U.S. 1053, 50 L.Ed.2d 770, 97 S.Ct. 768 (1977) (Brennan, J., dissenting, joined by Marshall, J.).
The objective of the compulsory joinder rule is to further the constitutional guaranty against multiple trials; it is therefore not concerned with multiple convictions or multiple punishments for separate offenses. See Abney v. United States, 431 U.S. at 660-61. The compulsory joinder doctrine has not yet commanded the majority required to make it a constitutional requirement, but there appears to be a trend in that direction among the federal circuits and in state courts and legislatures. See Note, 15 Am. Crim. L. Rev. 259, 287-88. Kansas, as we shall see, adopted the doctrine some forty-five years ago.
B. The Kansas Rule. In Kansas, the public policy regarding multiple prosecutions has been of legislative concern since Territorial days. Our first jeopardy statute, former K.S.A. 62-1444, found its origin in the Territorial Statutes of 1855. From 1868 until its repeal effective July 1, 1970, it provided:
"When the defendant has been convicted or acquitted upon an indictment or information for an offense consisting of different degrees, the conviction or acquittal shall be a bar to another indictment or information for the offense charged in the former or for any lower degree of that offense, or for an offense necessarily included therein."
This is traditional, constitutional double jeopardy language. Kansas from the beginning used the "same evidence" test in *735 determining whether a second prosecution was barred. See e.g., State v. Horneman, 16 Kan. 452 (1876), where the court quoted Wharton in ruling that a prosecution for shooting a person was not barred by double jeopardy where the former prosecution was for shooting a horse, even though both charges arose out of the same shooting: "Where the evidence necessary to support the second indictment would have been sufficient to procure a legal conviction upon the first, the plea is generally good, but not otherwise." 16 Kan. at 454.
Similar traditional analysis led to the result in the watershed case of In re Brown, 139 Kan. 614, 32 P.2d 507 (1934). There the accused was tried on an information charging one count of statutory rape. The crime was alleged to have occurred within the preceding two years, but not on any particular date. At trial evidence of many occurrences of sexual intercourse during the two-year period was presented, and the State eventually elected to rely upon occurrences of March 18, 1932. When the accused was acquitted of this charge, the State brought new charges for the same offense against the same person on five specific dates, all included within the time covered by the first prosecution. Defendant filed an original proceeding in habeas corpus which the Court denied, holding that the "accused will not be `twice put in jeopardy for the same offense' (Bill of Rights, § 10) as to any occurrence other than that of the date relied on (March 18, 1932) in the first trial." 139 Kan. at 615, Syl. ¶ 4. The result was that although evidence of many separate crimes had been admitted in the first trial, because only one had been ultimately relied on the State could retry him separately on each of the others.
The decision in Brown evoked an immediate reaction from the legislature. The following year it enacted Laws of 1935, ch. 163, § 1, which later became K.S.A. 62-1449:
"When one is properly charged in one or more counts of a complaint, indictment, or information with an offense, or offenses, against any of the laws of the state, and upon the trial of the action evidence is admitted of other offenses which might have been included as other counts in the complaint, indictment, or information, or on which the state might have elected to rely in the action then being tried, a conviction or acquittal on the charge, or charges, as made in the complaint, indictment, or information, shall operate as a bar to any subsequent prosecution of the same person in another action for any act or acts for which the state could have asked for a conviction under the complaint, indictment or information in the former trial."
*736 The statute is clearly designed to reverse the rule of Brown and is a codification of the compulsory joinder rule. That legislative motive and the broad thrust of the statute were fully recognized in State v. Momb, 150 Kan. 674, 95 P.2d 349 (1939); State v. Momb, 154 Kan. 435, 119 P.2d 544 (1941), and Struble v. Gnadt, 164 Kan. at 589-90. As the Court said in the second Momb case, "It is common knowledge the 1935 statute, here involved, was enacted for the express purpose of changing the law of jeopardy as laid down in our 1934 decision in the case of In re Brown, 139 Kan. 614, 32 P.2d 507." 154 Kan. at 440-41.
In the Momb cases three separate indictments had been returned against Momb for blackmailing operators of slot machines. Each indictment charged a similar offense, the essential difference being that each offense was committed against a different person, named respectively Mans, Hiemerman and Ketzner. The first case tried involved Momb's alleged blackmailing of Mans, and the jury returned a verdict of not guilty.
The second case to be tried involved Hiemerman. Momb filed a plea in abatement based on 62-1449, because in the Mans prosecution evidence of the Hiemerman offense had been admitted, presumably to show intent or plan of operation. (Today the same justification would be under K.S.A. 60-455.) The trial court sustained the plea, but on appeal the Supreme Court reversed in the first Momb case, State v. Momb, 150 Kan. 674. The Court's reasoning was that the Hiemerman offense was not in fact charged in the Mans indictment so that Momb could not have been convicted of it. Hence, the Court felt, he had not really been in "jeopardy" on the Hiemerman count.
After the remand of the Hiemerman case the State elected to go to trial instead on the third, or Ketzner indictment. Momb again filed a plea in abatement raising the issue of double jeopardy under 62-1449. In support of his plea he introduced the indictment in the Mans case as well as testimony by Ketzner in that case, which if believed fully established the commission of the Ketzner offense. Momb's plea was overruled at the trial level and he was convicted of the Ketzner offense. In the second Momb case the Supreme Court reversed, overruling the first Momb case in the process.
In its re-examination of the statute the Court held:
"There can be no doubt concerning the fact that the statute deals with jeopardy. *737 It clearly was intended to supplement the existing law upon that subject in some manner. The title of the act clearly says so. The title also says the act relates to subsequent prosecutions. In what respect, or respects, did the act undertake to supplement the existing law of jeopardy with respect to subsequent prosecutions? It appears the statute was intended to supplement the former law of jeopardy by erecting a new bar in two separate and distinct instances or circumstances. Those instances or circumstances were separated in the statute by the use of the disjunctive word `or.' For the purpose of clarity we have separated those instances or circumstances by inserting the numbers (1) and (2) in the statute. So read that portion of the statute provides:
"`... and upon the trial of the action evidence is admitted of other offenses which [1] might have been included as other counts in the complaint, indictment, or information, or [2] on which the state might have elected to rely in the action then being tried....' (Emphasis supplied.)
"Upon careful reexamination of the statute, it is the opinion of the majority the concluding portion of the statute, to wit: `for which the state could have asked for a conviction under the complaint, indictment or information in the former trial,' cannot be read and interpreted independently from, but must be read and construed in conjunction with, the title and the former part of the statute which expressly designates the two new instances or circumstances with respect to which the former law of jeopardy was intended to be supplemented. In other words, it would appear the lawmakers, by the use of the words contained in the concluding portion of the statute, to wit: `could have asked for a conviction under the complaint, indictment or information in the former trial,' intended the former trial should operate as a bar to a subsequent prosecution under either of the two circumstances previously expressly designated in the statute. Applying that interpretation, it means the subsequent prosecution in the instant (Ketzner) case, was barred if the state could have asked for a conviction on the Ketzner offense had that offense been included as a separate count in the indictment in the Mans case. Clearly, and admittedly, that offense might have been included. Clearly, had that offense been included, the state could have asked for a conviction on the Ketzner count under the indictment in the former trial. The result is the instant action is barred." 154 Kan. at 440. Emphasis added.
The second Momb decision was handed down on the same day as Claflin v. State, 154 Kan. 452, 119 P.2d 540 (1941), which involved several fires occurring over a short period of time at a fraternity house at the University of Kansas. Claflin had originally been charged with four counts of arson in one complaint. The State later dismissed that complaint and filed four separate complaints, based on four separate fires. He was bound over for trial and four separate informations were filed. He was first tried and acquitted on one of the informations (No. 3786). The only material evidence showing Claflin to have been the arsonist was a confession in which he admitted committing all four offenses. After his acquittal on the first charge (presumably because the *738 confession was coerced) Claflin sought a writ of habeas corpus to prevent being tried on the other three informations. The district court denied the writ, but the Supreme Court reversed, saying:
"Here the matter to be decided seems to fall precisely under the letter and purpose of the statute of 1935. The offenses charged against Claflin not only could be but originally were charged in four counts of a single complaint. There was no change in those charges when by a mere strategical maneuver of the prosecution the same four identical charges were filed against him in four separate complaints and the first complaint dismissed. And certainly there would not have been the slightest difficulty in including all four of the complaints as counts in one information. Moreover, even without the statute of 1935, simple justice to the accused, as well as a decent regard for the taxpayers of Douglas county, should have prompted the state to avoid four lengthy and expensive criminal trials on the four charges so similar in every respect by including them in one information and by putting the accused to the hazard of conviction in one fair trial before a jury and no more. The evidence relied on for conviction in information No. 3786 was the purported confession of Claflin completely covering all four attempts to set fire to the building; and that confession was not more applicable to the offense charged in information No. 3786 than it was to each of the other offenses. The evidence as to the commission of those other offenses did not creep into the case on trial casually or incidentally. It was thoroughly aired in all its details. Indeed, it constituted all the material evidence in the case tried  so much so that the trial court instructed the jury not merely to disregard the confession if they believed defendant was coerced into making it but to acquit him without hesitation. That instruction manifestly was prompted by the fact that the state had no other evidence to produce on which to ask for a conviction.
"Furthermore, the circumstances of the four alleged offenses were so similar in every respect that the state's evidence  that is, the confession  if believed to have been obtained voluntarily, would have justified a verdict of guilty whichever one of the four informations, Nos. 3786, 3787, 3788 or 3789, had been used as the basis of the prosecution in the case which was tried." 154 Kan. at 455-6. Emphasis added.
In Struble v. Gnadt, 164 Kan. 587, the Court affirmed the denial of a writ of habeas corpus based on a jeopardy claim under 62-1449. There evidence of the three offenses charged had been introduced in a preliminary hearing, not at a trial. In concluding there had been no jeopardy, the Court commented on Momb and Claflin:
"These are the only opinions in which we have considered this section. It will be seen that in both the Momb and Claflin cases there had been a trial in the district court where all the evidence sought to be used in the trial of the subsequent case had been used in the trial of the first case, the defendant had been acquitted, and the statute had been invoked to prevent the defendant being tried again and the same evidence used. In the Claflin case we did, it is true, say that simple justice would require that defendant should have been tried for all four offenses as *739 separate counts in the same information. We did not say, however, we would have allowed the writ for that reason alone had it not been for the statute." 164 Kan. at 591.
The effect of 62-1449 was discussed in a different context in State v. Neff, 169 Kan. 116, 218 P.2d 248, cert. denied 340 U.S. 866 (1950), where the defendant attacked the joinder of two murder charges on the ground that the two offenses were unrelated. The Court rejected this argument and ruled that the trial court did not abuse its discretion in refusing to require an election, since the State's direct evidence tying the defendant to the murder in both cases consisted of a single written confession. The Court noted:
"Appellant, however, also overlooks our 1935 legislative enactment relied on by the state, G.S. 1935, 62-1449. Had the state filed separate informations on these offenses and introduced the confession, evidence covering both offenses, in the first trial a later prosecution on the other count not included in the information of the first case tried would have been barred by virtue of that statute. (State v. Momb, 154 Kan. 435, 119 P.2d 544; Claflin v. State, 154 Kan. 452, 119 P.2d 540.) The state was not compelled to pursue a course which precluded a trial of both offenses." 169 Kan. at 122.
The circumstances which triggered the application of 62-1449 were restated in State v. McCarther, 198 Kan. 48, 422 P.2d 1012 (1967), where the Court considered appeals from three convictions of first-degree robbery. McCarther committed the three robberies after he had escaped from the county jail awaiting trial on other charges and while he was a fugitive from justice. Upon his capture, McCarther was also charged with one count of escape from jail. The State sought to consolidate the escape charge with the three robbery charges for trial, but this motion was overruled. McCarther was tried on the escape charge alone, then on the three robbery charges. Both trials resulted in convictions.
On appeal from the robbery convictions, McCarther contended that his prosecution for the robberies was barred by 62-1449. The Court rejected this contention, reasoning:
"K.S.A. 62-1449 is not applicable to the facts of this case. An essential component of 62-1449, supra, is the admission of evidence at the first trial. The sense of the statute is that the state may not retry a defendant for any offense which might have been included as an additional count in the information or on which the state might have elected to rely when evidence thereof was admitted at the first trial. (State v. Momb, 154 Kan. 435, 119 P.2d 544; 9 Kan. L. Rev. 440.)
"Thus, if evidence of the Maxwell, or the Brown, or the Jershin robberies had been admitted at McCarther's trial for escaping jail, we think the statute (62-1449, *740 supra) would have application. However, it is precisely in the area of evidence admitted at the escape trial that the defendant's argument is fallacious. In short, our attention is not directed to the admission of any evidence in the escape case which tended to prove either one or more of the foregoing robberies." 198 Kan. at 50.
The only evidence in the jail escape trial which McCarther could point to as constituting evidence of the robberies was the testimony of the jailer who checked McCarther back into jail after his escape. He testified that "we retyped the book-in sheet on him and added the new charges on the commitment they brought in." 198 Kan. at 50. The Court concluded that this evidence did not constitute "evidence ... of other offenses" within the meaning of 62-1449.
The distinction between the compulsory joinder rule embodied in 62-1449 and the identity of elements test grafted on 62-1444 was recognized in Coverly v. State, 208 Kan. 670, 493 P.2d 261 (1972). The events there also involved an escape from the county jail, which was accomplished by an assault on the jailer. The defendant first pleaded guilty to the escape charge, then to the assault charge. He later filed a motion under 60-1507 asserting that: (1) the assault and the jail break were so interwoven as part of one continuous transaction that the State could not separate and make two offenses of them; and (2) conviction of the escape charge barred prosecution for the assault. This assertion was based on both the constitution and on the statutory provisions of 62-1444 and 62-1449.
In rejecting the constitutional argument, the Court noted that the proper test concerning whether a single transaction may constitute two separate and distinct offenses is the "same evidence" or identity of elements test  whether each offense required proof of a fact which the other does not. Since proof of a jail escape is not necessarily proof of assault, and vice versa, prosecution for both did not constitute double jeopardy. The same reasoning applied as well to the argument based on 62-1444, since the test in applying that statute was also the "same evidence" test. However, application of the "same evidence" test did not dispose of the argument based on 62-1449. The application of 62-1449 turned not on the evidence necessary to sustain each *741 charge, but the evidence introduced at a prior trial. As the Court stated:
"Appellant's argument under former K.S.A. 62-1449... is slightly different. The thrust of the section is double jeopardy, but the operational fact is a trial at which evidence is introduced. As was stated in State v. McCarther, 198 Kan. 48, 50, 422 P.2d 1012:
"`... An essential component of 62-1449, supra, is the admission of evidence at the first trial. The sense of the statute is that the state may not retry a defendant for any offense which might have been included as an additional count in the information or on which the state might have elected to rely when evidence thereof was admitted at the first trial.' (Italics in the original.)
"Thus if there had been a separate trial of the jail break charge at which evidence of the assault had been admitted, subsequent prosecution for the assault would have been barred under the statute. The state's remedy, had the matter gone to trial, would have been to include both charges as separate counts in one information or to have sought a consolidation.
"Here, however, there was no trial and no evidence introduced. The statute was therefore inapplicable, as the court below correctly held." 208 Kan. at 672-3.
C. It is against this historical background that we must construe our present statute, K.S.A. (now 1978 Supp.) 21-3108(2)(a). The 1968 Judicial Council Comment on the then proposed legislation stated:
"Subsection (2) provides that in certain instances an earlier prosecution may bar a subsequent prosecution for a different offense, whether a violation of a different statute or a different violation of the same statute.
"Subsection (2) (a) provides a bar, under circumstances now included within K.S.A. 62-1449."
Analysis of the statute bears out the Comment. It actually incorporates both the compulsory joinder rule of former 62-1449 and the constitutional identity of elements rule in one subsection, with two clauses separated by a semicolon:
"(2) A prosecution is barred if the defendant was formerly prosecuted for a different crime ... if such former prosecution:
"(a) Resulted in either a conviction or an acquittal and the subsequent prosecution is for a crime or crimes of which evidence has been admitted in the former prosecution and which might have been included as other counts in the complaint, indictment or information filed in such former prosecution or upon which the state then might have elected to rely;
[compulsory joinder rule]
or was for a crime which involves the same conduct, unless such prosecution requires proof of a fact not required in the other prosecution, or the crime was not consummated when the former trial began...."
[identity of elements rule]
*742 The first clause, it will be seen, is essentially the same as the former 62-1449.
The independence of the two clauses was recently recognized in State v. Edgington, 223 Kan. 413, 573 P.2d 1059 (1978). The defendant there, a city councilman of Overland Park, had been previously prosecuted for failing to report a change in his income as required by K.S.A. 75-4302(d), resulting in an acquittal. He was then prosecuted and convicted for perjury for lying about his income in a divorce proceeding. On appeal from the perjury conviction, he argued that the compulsory joinder portion of 21-3108(2)(a) barred the perjury prosecution because certain physical evidence (checks representing income) which had been used in the first trial was also used in the second.
Although the Court did not accept the argument, it did agree that the defendant's grammatical analysis of the statute  i.e., as having two separate parts  was "technically correct." Even on that basis, however, there was no bar to the subsequent prosecution because the checks as introduced in the first trial did not constitute "evidence" of perjury as charged in the second. As the Court put it:
"Specifically, in the first trial, there was no evidence of the crime of perjury. The state did introduce facts, including physical evidence, which were common to each prosecution and which in the context of each prosecution, became evidence supporting that particular offense. The checks which were introduced in the perjury trial were not evidence of perjury until the defendant's testimony in the divorce proceeding was admitted. Similarly, in the misdemeanor trial, while the checks became evidence of a change of substantial interest, the checks were not evidence of another crime, i.e., perjury." 223 Kan. at 417.
Under the Kansas compulsory joinder statute, then, if evidence is admitted of an offense not contained in the charge, later prosecution of that offense is barred if it could have been included as an additional count in the first prosecution.
Typical might be a bad check prosecution in which the defendant has given ten $100 checks to ten different merchants the same day, at a time when he has but $95 in the bank. Intent to defraud, an element of the crime under K.S.A. 21-3707, might remain in doubt if the evidence were limited to any one check. The $95 in the bank would be heavily relied on to negate intent. The prosecution, however, could eliminate any reasonable doubt by introducing evidence of the other nine in a prosecution on any *743 one. The $95 would have little value in showing excusable mistake in the face of $1,000 in checks. But after conviction or acquittal on the one check charged, further prosecution on the other nine would be barred. They could have been joined, and if prosecution was desired they should have been joined.
On the other hand the "same evidence" rule has some relevance even when applying the compulsory joinder statute. Where the same evidence is common to two or more distinct offenses but standing alone does not substantially prove them, its use in one prosecution will not bar a subsequent prosecution for a different offense and its use therein. That was the situation in Edgington, where the checks in the first trial merely showed income earned by defendant while a public officer. Defendant's testimony in the divorce case was obviously not introduced in that trial. Without it there was no evidence from which the jury could have even speculated that defendant had committed the "other offense" of perjury. By way of contrast, in Momb the "other offenses" were fully proved in the first prosecution; in Claflin the confession virtually proved the "other offenses," leaving only the existence of the fires to complete the State's case. The object of the statute is simply to prevent the prosecution from substantially proving a crime in a trial in which that crime is not charged, and then prosecuting the defendant  in effect retrying him  for the same offense in a trial where it is charged.
V.
For the Kansas statute to bar a prosecution under the circumstances present in this case three elements must coalesce: (1) The prior prosecution must have resulted in either a conviction or an acquittal; (2) evidence of the present crime must have been introduced in the prior prosecution; and (3) the present crime must be one which could have been charged as an additional count in the prior case.
Again putting aside the effect of the void conviction for criminal injury, we find as to those elements:
(1) As pointed out in Section I above, the jury verdict acquitted petitioner of aggravated battery, the crime charged.
(2) On petitioner's motion for discharge of the child abuse cases it was stipulated by the State that "[m]uch of the evidence which will be offered in support of the present information is the same evidence which was admitted on behalf of the prosecution" *744 in the aggravated battery case. In answer to the trial court's question as to whether the evidence would be the same, the prosecutor's response was "that that would be essentially the case. There may be more or less evidence, different things to come into light." Before this court it was conceded that all the evidence necessary to prove abuse of a child, including the fact that the victim was an infant, was placed before the jury in the aggravated battery trial. Despite a minor discrepancy in the date the mistreatment of the child began, it is apparent that the entire pattern of conduct now relied on was placed before the jury in all its essential details. We conclude that evidence of the present charges was introduced.
(3) There seems little doubt but what petitioner could have been charged with the present child abuse counts as separate counts of the aggravated battery information. Under K.S.A. 21-3107(1), "When the same conduct of a defendant may establish the commission of more than one crime under the laws of this state, the defendant may be prosecuted for each of such crimes. Each of such crimes may be alleged as a separate count in a single complaint, information or indictment." Further, under K.S.A. (now 1978 Supp.) 22-3202(1), "Two or more crimes may be charged against a defendant in the same complaint, information or indictment in a separate count for each crime if the crimes charged, whether felonies or misdemeanors or both, are of the same or similar character or are based on the same act or transaction or on two or more acts or transactions connected together or constituting parts of a common scheme or plan." The crimes involved here meet the criteria of both statutes for joinder. Further, applying the identity of elements test, the offenses are separate. Under the facts of this case the aggravated battery charge required the intent to injure and the actual infliction of great bodily harm, neither of which is required for child abuse. The latter, in turn, requires a victim under 18 years of age, an element not required for aggravated battery. Accordingly petitioner could have been charged with all counts in the original information.
We conclude, therefore, that all the factors required to bring the 21-3108(2)(a) barrier into play are present in this case.
VI.
We return finally to the effect of the jury verdict finding petitioner guilty of criminal injury to a person.
*745 If we were concerned only with double jeopardy in the federal constitutional sense the result would be apparent. Under present federal law the nullification of a conviction wipes the slate clean, and the defendant may be charged and convicted of any offenses arising out of the same transaction which may be proved, regardless of whether they were or could have been charged originally. United States v. Ewell, 383 U.S. 116, 15 L.Ed.2d 627, 86 S.Ct. 773 (1966). But compare North Carolina v. Pearce, 395 U.S. 711, 721, 23 L.Ed.2d 656, 89 S.Ct. 2072 (1969) (because "the slate has been wiped clean," a more severe sentence may be imposed on reconviction than was originally imposed) with Blackledge v. Perry, 417 U.S. 21, 40 L.Ed.2d 628, 94 S.Ct. 2098 (1974) (emphasizing that due process prohibits a more severe penalty if imposed for "vindictiveness," i.e., if there is potential retaliation for defendant's pursuit of an appeal).
In Kansas, however, we are again governed by statute, this time subsection (4) (c) of 21-3108:
"(4) A prosecution is not barred under this section:
....
"(c) If subsequent proceedings resulted in the invalidation, setting aside, reversal or vacating of the conviction, unless the defendant was adjudged not guilty."
At first blush this would seem to imply a complete wiping clean of the slate, permitting a treatment of the first trial as a nullity. This, of course, is not so. The "implied acquittal" rule of the higher offense of Green v. United States and Benton v. Maryland, codified in subsections (1) and (5) as described in Section III of this opinion, is unaffected by (4) (c). The Judicial Council Comment observes:
"Under subsection (4) (c) it is not material whether the defendant's conviction is set aside as a result of his collateral attack or his direct appeal. In either case he has waived his claim to second jeopardy. However, where the new trial is granted after conviction for an offense included in the crime originally charged, the subsequent prosecution is limited to the included crime for which the defendant was convicted." Emphasis added.
Thus despite the sweeping language of (4) (c), other portions of the statute continue to operate even after a conviction is set aside, for whatever reason. In our opinion the compulsory joinder rule is one of them.
Before the present Code was adopted we had much the same situation. Former K.S.A. 62-1602, going back to 1868, provided *746 that "[t]he granting of a new trial places the parties in the same position as if no trial had been had; the former verdict cannot be used or referred to either in the evidence or argument." This statute was the basis of the rule that by asking for a new trial, whether by motion, by appeal, or otherwise, the defendant waived any claim of double jeopardy. The rule was first announced in State v. McCord, 8 Kan. 232 (1871), holding that a defendant charged with first degree murder and convicted of third degree manslaughter could, on a new trial, be convicted of murder.[3]McCord was consistently followed in a long line of cases, a number of which are cited in State v. Young, 200 Kan. 20, 24, 434 P.2d 820 (1967).
Obviously this drastic version of "wiping the slate clean" fell before the new code, plus Green and Benton. The new code incorporates all jeopardy rules in one section. Our job, as we see it, is to construe the statute as a harmonious whole, reconciling any apparent conflicts if need be. Where the codification of Green and Benton in subsections (1) and (5) would conflict with the general language of subsection (4) (c), the specific language would control. Likewise where the specific language of the compulsory joinder subsection (2) (a) would conflict, it too would control.
The result is that when a conviction is set aside any new trial is limited to the crime originally charged or, if conviction was on a lesser included offense, "the included crime for which the defendant was convicted." (Judicial Council Comment, quoted above.) To that extent the defendant, by seeking to have the conviction invalidated, may be said to have "waived" the double jeopardy claim.[4]
On the other hand, we see no justification for saying that a defendant who successfully appeals from one conviction thereby opens the door to the institution of multiple prosecutions for *747 other crimes which have already been proven in the first trial and which would otherwise no doubt be barred by our statute. Multiple prosecutions (here three originally, ultimately two felony counts), if permissible, would present the same potential for retaliatory vindictiveness warned against in North Carolina v. Pearce and proscribed in Blackledge v. Perry. There is no suggestion of vindictiveness here, but under Blackledge the significant factor is the potential, not the fact of vindictiveness.
Further, even one count, different from and not included in that originally charged, permits the prosecution to "mend its hold" in the light of experience in the first trial. Although spoken in the context of the collateral estoppel rule there being formulated, the Court's words in Ashe v. Swenson are appropriate here:
"In this case the State in its brief has frankly conceded that following the petitioner's acquittal, it treated the first trial as no more than a dry run for the second prosecution: `No doubt the prosecutor felt the state had a provable case on the first charge and, when he lost, he did what every good attorney would do  he refined his presentation in light of the turn of events at the first trial.' But this is precisely what the constitutional guarantee forbids." 397 U.S. at 447.
Again, there is no suggestion that the State chose its present position deliberately  its plight was obviously thrust upon it. From petitioner's point of view, however, it makes little difference whether he is to be retried from design or from chance. Either way he must run the gantlet again on charges he has already faced.
What we have been discussing applies even to a case where the defendant has been simply convicted of the offense originally charged. If he later secures a reversal or other invalidation of the conviction, the policy reasons leading to the enactment of 62-1449 and our present statute would preclude retrial on charges other than the original. In this case we have the added factor that defendant was acquitted of the original crime charged. It seems to us that this is an a fortiori case for applying the compulsory joinder rule to prevent retrial for crimes which were proved in all their elements on the first trial.
Such a result means that the prosecution, and thus the people of the state, may appear to be penalized because of a misplaced reliance on a statute presumed to be constitutional. In the search and seizure context the question is classically put in terms of whether "[t]he criminal is to go free because the constable has *748 blundered." Mapp v. Ohio, 367 U.S. 643, 659, 6 L.Ed.2d 1081, 81 S.Ct. 1684 (1961) (quoting Justice [then Judge] Cardozo in People v. Defore, 242 N.Y. 13, 21, 150 N.E. 585 [1926].) Here, it is whether he is to go free because the prosecutor has "bungled."
In both instances, the good faith of the State's official is unquestioned; the weight to be accorded that factor is in question. In search and seizure cases the answer has always been that the subjective good faith of the State's agent is not determinative. As the Supreme Court has repeatedly said:
"`[G]ood faith on the part of the arresting officers is not enough.' Henry v. United States, 361 U.S. 98, 102, 4 L.Ed.2d 134, 138, 80 S.Ct. 168. If subjective good faith alone were the test, the protections of the Fourth Amendment would evaporate, and the people would be `secure in their persons, houses, papers and effects,' only in the discretion of the police." Beck v. Ohio, 379 U.S. 89, 97, 13 L.Ed.2d 142, 85 S.Ct. 223 (1964).
See also Terry v. Ohio, 392 U.S. 1, 22, 20 L.Ed.2d 889, 88 S.Ct. 1868 (1968); Scott v. United States, 436 U.S. 128, 136-7, 56 L.Ed.2d 168, 98 S.Ct. 1717 (1978).
The judicial choice is whether the price to be paid for a seemingly innocent mistake is to be paid by the state or by the defendant. Our system of government tries that balance and invariably finds the balance in favor of the individual.
We cannot quarrel with the prosecutor's initial decision to consider the entire week-long episode as but one crime, or with the decision to prove it all as one charge. Sound prosecutorial discretion frequently dictates one charge when multiple charges are legally possible. Further, separation would have encountered hazards of its own, and might well have run into allegations of duplicitousness, a variant of the problem of double jeopardy. See e.g., State v. Thornton, 224 Kan. 127, 577 P.2d 1190 (1978); State v. Lassley, 218 Kan. 758, 545 P.2d 383 (1976); Jarrell v. State, 212 Kan. 171, 510 P.2d 127 (1973). The fact remains that petitioner was acquitted of the crime chosen by the state for its charge, and only convicted of a crime which proved as a matter of law to be no crime at all.
We hold that trial on the present charges is barred by the provisions of K.S.A. 1978 Supp. 21-3108(2)(a). We believe this is the legislative resolution in this case of the conflict between the State's interest in punishing offenders and the individual's right to be tried only once for the same crime.
*749 In view of our conclusion we need not consider petitioner's other points. Since petitioner cannot be tried again on the present charges his present custody is, in the language of K.S.A. 60-1505(d), "wrongful."
The writ is allowed and petitioner discharged.
NOTES
[1]  Although petitioner is free on bond, he is in "custody" for the purposes of a habeas corpus action. Hensley v. Municipal Court, 411 U.S. 345, 36 L.Ed.2d 294, 93 S.Ct. 1571 (1973); United States ex rel. Russo v. Superior Court of N.J., Etc., 483 F.2d 7 (3d Cir.) cert. denied 414 U.S. 1023 (1973); Burris v. Ryan, 397 F.2d 553 (7th Cir.1968).
[2]  See e.g., United States Court of Appeals cases cited in n. 1, supra.
[3]  McCord also relied on the predecessor of former K.S.A. 62-1301, which defined a new trial as "a re-examination of the issue." "The issue," the Court said, was the issue presented in the first trial. Although the question was not raised, the case gives no hint that the new trial could be on issues which were not present in the first trial.
[4]  Waiver is, of course, but one theory used to justify the right of retrial, and is used here as convenient shorthand to cover the undeniable right, regardless of theory. See United States v. Tateo, 377 U.S. 463, 466, 12 L.Ed.2d 448, 84 S.Ct. 1587 (1964).
