
292 N.W.2d 432 (1980)
STATE of Iowa, Appellee,
v.
John Barry Lee YOUNG, Appellant.
No. 64039.
Supreme Court of Iowa.
May 21, 1980.
*433 Douglas V. Coonrad, Hudson, for appellant.
Thomas J. Miller, Atty. Gen., Julie F. Pottorff, Asst. Atty. Gen., and David H. Correll, Black Hawk County Atty., for appellee.
Considered by LeGRAND, P. J., and UHLENHOPP, HARRIS, McCORMICK, and LARSON, JJ.
UHLENHOPP, Justice.
This appeal involves the propriety of a sentence imposed for third-degree theft.
Iowa Rule of Criminal Procedure 22(3)(d) states in part:
The court shall state on the record its reason for selecting the particular sentence.
With reference to penitentiary and reformatory sentences, section 246.38 of the Code provides in part:
[I]f an inmate had been confined to a county jail or other correctional or mental institution at any time prior to sentencing, or after sentencing but prior to the case having been decided on appeal, because of failure to furnish bail or because of being charged with a nonbailable offense, the inmate shall be given credit for such days already served in jail upon the term of the sentence. The clerk of the district court of the county from which the inmate was sentenced, shall certify to the warden the number of days so served.
Section 901.6 provides in part:
In every case in which judgment is entered. . . a statement of the days credited pursuant to section 246.38 shall be incorporated into the sentence.
Rule of Criminal Procedure 23(5)(a ) states:
The court may correct an illegal sentence at any time.
Defendant John Barry Lee Young, age twenty-one, has a history of encounters with the law dating back to age thirteen. In March 1976 he was sentenced to ten years for a felony and placed on probation. While on probation he was convicted and fined (or jailed) over a three-year span for indecent exposure (three convictions), disturbing the peace (two convictions), and failure to appear on a traffic charge. Following the latest of those offenses his ten-year sentence with probation was changed to 365 days in jail. He was then placed in a community correctional facility to serve his time, see chapter 356A, and put on work release. §§ 356.26-356.35, 356A.4, The Code (1979). The State claims that while defendant was thus on work release he committed the crime for which the sentence now in question was imposed. We turn first to the facts.
A teacher named Southworth owned a Raleigh "Professional" bicycle, rode it to school on June 1, 1979, and placed it in the boiler room of the building. Allegedly defendant stole the bicycle from there. An assistant county attorney charged defendant with second-degree theft under section 714.2(2) of the Code (property worth between $500 and $5000). The minutes attached to the information stated that witnesses would testify the bicycle cost $592.25 in 1974, had $300 worth of accessories added, and was worth at least $700 at the time in question. The district court did not require bail under the charge and ordered defendant released under a pre-trial release program.
A probation officer asked the district court to revoke defendant's work release under the prior jail sentence on three specified grounds not related to the present offense, *434 and the district court found probable cause to do so and ordered a warrant to issue. Defendant was placed in jail, where he remained until the penitentiary sentence in the present case was subsequently imposed.
While defendant denied throughout the present proceedings that he stole the bicycle, he entered into an Alford-type plea agreement with the assistant county attorney to plead guilty to third-degree theft, an aggravated misdemeanor under section 714.2(3) of the Code (property worth between $100 and $500). He tendered such a plea to the district court. See North Carolina v. Alford, 400 U.S. 25, 91 S.Ct. 160, 27 L.Ed.2d 162 (1970).
At the hearing on the tendered plea the assistant county attorney made this statement among others:
Your Honor, if the state were called upon to present this case at trial, we would basically call witnesses which would testify that there was a Raleigh 10-speed bicycle the value of which we would stipulate at this time is over $100 but below $500, and [in?] keeping with the plea of Theft in the Third Degree.
After complying with the plea-hearing requirements of Iowa Rule of Criminal Procedure 8(2)(b ), the district court accepted the plea, set a date for imposition of sentence, and ordered a presentence investigation.
In the recitation of the facts in its presentence report to the court, which was also furnished to the parties, the Department of Correctional Services stated that the theft was of a "very expensive professional bicycle" and also:
The bicycle was purchased by Mr. Southworth in September of 1974 for $592.25, and approximately $300.00 worth of accessories had been added to it. At current replacement costs of the bicycle and the many accessories on it, it was worth $1,212 at the time of the theft.
After a broad-ranging discussion regarding defendant, his problems, and his record, the Department concluded in its report that defendant should be imprisoned and recommended a sentence of two years.
At the subsequent sentencing hearing the court stated inter alia that
a presentence investigation has been filed and made available including the recommendation portion to the parties . . . I will ask both parties if there is any substantial error or omission in the report, is it accurate so far as the State is concerned?
Ms. McGiverin (assistant county attorney): Yes, Your Honor.
Mr. Long (defense counsel): I need about six seconds.
Your Honor, we will state that the factual portion is substantially correct. We of course don't agree with all the conclusions reached.
The county attorney recommended two-years imprisonment. Defense counsel made alternative pleas (in the following order) for probation, or for commitment to the community correctional residential treatment facility, or for credit for time served in jail over the summer until sentencing.
The district court sentenced defendant to a term of two-years imprisonment and stated its reasons in extenso. See Iowa R.Crim.P. 22(3)(d ). In the course of its remarks the court stated:
First of all, the nature and circumstance of the offense, it appears to me that as a third degree theft it is aggravated for the reason that I believe that upon trial you could well have been convicted of theft in the second degree because of the value of this bicycle.
After the court imposed sentence the following colloquy occurred:
Mr. Long: One other question, Your Honor, say my time for motions and such, I know in a normal situation the code provides that a defendant gets credit for time served. This is sort of an abnormal situation in that he was at the Ellis [community correctional facility] and because of this being transferred back and had to sit in jail. Should he have credit for the time served here?
The Court: I considered that and I rejected it.
*435 Defendant appealed. In his appeal he contends that the district court erred, first, in considering that defendant could well have been convicted of second-degree theft and second, in refusing to give credit on the sentence for the time defendant spent in jail prior to sentencing. The State asserts that neither contention has merit, and that in any event defendant's failure to present the contentions to the district court by motion bars him from presenting them to us now. We retained the appeal primarily to consider the latter question.
I. Presentation and preservation of error. We first take up the State's assertion that the appeal is premature because defendant failed to present the issues by motion to the district court under rule 23(5)(a).
We first call attention to the scope of that rule; it deals with an "illegal" sentence. For the meaning of that expression, see Hill v. United States, 368 U.S. 424, 82 S.Ct. 468, 7 L.Ed.2d 417, rehearing denied, 369 U.S. 808, 82 S.Ct. 640, 7 L.Ed.2d 556 (1962) (decided when federal criminal rule 35 read as our rule presently does). We need not decide whether defendant's charges against the present sentence, if established, would render it "illegal" under rule 23(5)(a), for we do not agree that a defendant must initially resort to that rule to correct an illegal sentence.
If a sentence is illegalfor example, a court mistakenly imposes a ten-year term when the statute authorizes a five-year maximumthe practice in this state has been for the district court to correct the illegality when it comes to that court's attention, or for this court to do so or to direct the district court to do so when it comes to this court's attention. Thus rule 23(5)(a ) really adds nothing new; it reflects what Iowa courts have been doing. See, e. g., State v. Van Klaveren, 208 Iowa 867, 873, 226 N.W. 81, 84 (1929) (this court sua sponte modified sentence to eliminate imprisonment for nonpayment of court costs); State v. Williams, 195 Iowa 374, 376, 191 N.W. 790, 791 (1923) ("when complaint is lodged against the judgment entered the defendant is privileged to have the error corrected on motion in the trial court or by appeal to this court"statute required imprisonment for nonpayment of fine to be at specified rate per day but sentence required imprisonment until fine paid); State v. Sayles, 173 Iowa 374, 383, 155 N.W. 837, 840 (1916) (this court on own initiative changed indeterminate sentence to determinate in accordance with statute for the particular crime). Nothing in rule 23(5)(a) expressly requires a motion thereunder prior to appeal, section 814.20 of the Code authorizes us to dispose of an appeal by affirmation, reversal, "or modification" of the judgment, and we prefer to remain with the prior practice. We thus reject the State's contention that rule 23(5)(a) must be initially applied. We do not suggest, of course, that a defendant would not have to proceed first under that rule if his time for appeal had otherwise elapsed; here he appealed in time. We thus proceed to the merits.
II. Consideration of second-degree theft. The State initially charged defendant with second-degree theft but later reduced the charge to third-degree theft. In sentencing defendant to the maximum imprisonment for third-degree theft, the district court took into consideration that defendant "could well have been convicted of theft in the second degree. . . ."
The problem presented is the common one in which a defendant is charged with a crime, a plea-bargain is struck, the State reduces the charge, and the defendant pleads guilty to the lesser offense. Under what circumstances may the sentencing court consider the higher crime?
We faced this issue in State v. Thompson, 275 N.W.2d 370 (Iowa 1979). We said, id. at 372:
The present case concerns the possibility that the accused's act on the occasion in question may have constituted a higher crime than the one to which he pleaded guilty. A sentencing court may, within statutory limits, impose a severe sentence for a lower crime on the ground that the accused actually committed a higher crime on the occasion involved if the facts *436 before the court show the accused committed the higher crime or the defendant admits itwhether or not the prosecutor originally charged the higher crime. This is part of making the punishment fit the crime. 24B C.J.S. Criminal Law § 1980 at 562, 565 ("The court should give due regard to the nature of the offense and the attending circumstances . . .. Punishment should always be commensurate with the crime"). A sentencing court may not however impose a severe sentence for a lower crime on the ground that the accused actually committed a higher crime unless the facts before the court show the accused committed the higher crime or the defendant admits it even if the prosecutor originally charged the higher crime and reduced the charge. The controlling consideration is whether the accused in fact committed the higher crime, not whether the prosecutor originally charged it. The original charge of the higher crime may or may not have been true, and the accused does not admit the higher charge by pleading guilty to the lower charge.
See also, State v. McKeever, 276 N.W.2d 385 (Iowa 1979). In McKeever we applied Thompson and said, id. at 389:
We conclude that the case must be reversed and remanded for resentencing on this basis, at which time the sentencing court may give weight to the nature of the offense committed or of a higher offense only to the extent that they are established by the evidence presented.
The present case differs from the problem of establishing a factual basis for a guilty plea. See State v. Sisco, 169 N.W.2d 542, 548-51 (Iowa 1969). By his plea of guilty a defendant admits that he committed the crime charged, and the Sisco factual basis requirement shows that the crime charged and admitted was committed. But the guilty plea does not admit that another, higher crime was committed. If the court uses the commission of a higher crime to inflict severe punishment for the crime actually charged and admitted, that higher crime must be shown, as Thompson holds, by the facts before the court or the defendant's admission.
The record here is sufficient to show an admission by defendant of a value in excess of $500. In the factual portion of the presentence report, furnished to the parties, the investigator described the vehicle as a very expensive professional bicycle, purchased in 1974 for $592.25, with accessories of $300 added. The report stated that at current replacement costs the bicycle was worth $1,212 at the time it was stolen.
At the sentencing hearing the court asked the parties if the report contained any substantial errors or omissions. Defense counsel stated on behalf of his client that the factual portion of the report was substantially correct. We hold this admission warranted the court's statement that "upon trial you could well have been convicted of theft in the second degree . . . ." See State v. Shepard, 247 Iowa 258, 267, 73 N.W.2d 69, 74 (1955), overruled on other grounds, State v. Jensen, 189 N.W.2d 919, 923 (Iowa 1971) ("`He (a party to the action) is bound by statements of his counsel;. . .'").
We are aware of the prosecutor's statement he would stipulate "at this time" that the value was over $100 but below $500 "and keeping with the plea of Theft in the Third Degree." The sentencing court was still entitled to rely on the facts in the presentence report. Defense counsel stated that those facts were substantially correct, and the prosecutor's stipulation does not annul that admission.
We hold that defendant's first contention is not well taken on this record.
III. Refusing credit for jail time. The second contention deals with the failure of the court to give defendant credit on his two-year sentence for the time he spent in jail prior to sentence. Since his present sentence was for more than one year, the court had to commit him to the director of adult corrections, see § 901.7, The Code, which meant confinement in the reformatory, penitentiary, or possibly the security medical facility. §§ 902.5, 217.13, 217.14(1), *437 The Code. This meant in turn that defendant had to be given credit if his prior jail confinement was "because of failure to furnish bail or because of being charged with a nonbailable offense . . . ." §§ 246.38, 246.45, The Code.
The question is whether defendant was confined through the summer under his 365-day prior jail sentence or for failure to post bail under the present charge. An application to revoke work release under the prior sentence was presented to the district court, the court found probable cause and ordered a warrant to issue, and defendant was placed in jail. Defendant is right that the assistant county attorney should have brought on the application to revoke work release for further hearing and order. Neither party however sought a further ruling, nor did defendant seek relief by way of habeas corpus or under the order in the present case releasing him to pretrial release. In any event, we are satisfied from the record that the district court could reasonably conclude defendant was in fact incarcerated in jail under the prior jail sentence rather than for failure to post bail under the present charge. Hence the court could refuse credit for that time in jail on the present sentence. (We note that the probation officer who requested revocation of work release under the prior sentence cited sections 908.2 and 908.11 of the Code, whereas sections 356.27 and 356A.4 would appear to be applicable. This however does not change the result.)
We do not find merit in either of defendant's contentions.
Defendant is of course entitled to credit on the 365-day prior sentence for the period he was in jail from June 18, 1979, to September 6, 1979, in addition to the time he was on work release. The remainder of that prior sentence runs concurrently with the present sentence, in accordance with the terms of the district court's present sentence.
AFFIRMED.
