
700 P.2d 76 (1985)
108 Idaho 454
STATE of Idaho, Plaintiff-Respondent,
v.
Andy ANDERSON, Defendant-Appellant.
No. 15096.
Court of Appeals of Idaho.
April 16, 1985.
*78 Alan E. Trimming and August H. Cahill, Jr. (argued), Ada County Public Defender's Office, Boise, for defendant-appellant.
Jim Jones, Atty. Gen., Lynn E. Thomas, Sol. Gen., Boise, for plaintiff-respondent.
WALTERS, Chief Judge.
We are asked to review the second degree murder conviction of Andy Anderson. Anderson asserts on appeal that the charge against him should have been transferred to juvenile court or dismissed. He also contends the sentence imposed was unduly harsh and thus constitutes an abuse of sentencing discretion. We affirm.
Anderson and four other juveniles were originally charged with first degree murder, resulting from the death of Christopher Peterman while the six youths  including Peterman  were incarcerated at the Ada County Jail. Peterman had been placed in a cell, which already contained the other five adolescents, on Friday, May 28, 1982. He was subjected to torture and beatings throughout the following weekend and on Monday, May 31, Chris Peterman died. Anderson entered a plea of not guilty to the first degree murder charge, but on April 1, 1983, pursuant to a plea arrangement with the state, he entered a plea of guilty to murder in the second degree. Following an evidentiary hearing, Anderson was sentenced to the custody of the State Board of Correction for an indeterminate term not to exceed twenty-one years.

I
The first issue on this appeal is whether the district court erred by denying Anderson's motion to either dismiss the murder charge, or in the alternative, to transfer his case to juvenile court.[1] By this motion, Anderson contended that the charge against him should be dismissed because I.C. § 16-1806A, the statute requiring Anderson to be tried as an adult, violated Anderson's due process and equal protection rights guaranteed by the United States Constitution. Alternatively, the motion asserted that section 16-1806A conflicts with I.C. § 16-1804, a provision of Idaho's Youth Rehabilitation Act (YRA), which should have controlled the jurisdiction of the charge against Anderson. After a hearing and extensive briefing were completed, the district court upheld section 16-1806A and retained jurisdiction of the cause. We find no error in the district court's decision.

A
I.C. § 16-1806A provides that any person aged fourteen years to age eighteen years who is alleged to have committed murder of any degree "shall be charged, arrested and proceeded against by complaint, indictment or information as an adult." Under I.C. § 18-216, a person may not be tried or convicted of an offense if he was fourteen to eighteen years old when the offense was committed unless the juvenile court has no jurisdiction under the YRA or juvenile court jurisdiction has been waived. I.C. *79 § 16-1803 grants to the juvenile court "exclusive, original jurisdiction over any child and over any adult who is a child at a time of any act, omission or status, found or living within the county ..." who commits enumerated unlawful acts. Because the applicability of sections 18-216 and 16-1803 turns on the person's age at the time an offense is committed, Anderson believes those sections create an expectation, which attaches at the time any unlawful act occurs, that a youthful offender will be dealt with under the YRA. He argues that section 16-1806A, on the other hand, does not apply unless a person is alleged to have committed one or more enumerated offenses. Because he was under age eighteen when the offense occurred and thus subject to YRA jurisdiction, but was subsequently charged with an offense outside YRA jurisdiction under section 16-1806A, Anderson contends section 16-1806A constitutes a waiver of a vested right without satisfying due process requirements. We disagree.
A principal rule governing statute interpretation requires the courts to give effect to the legislative intent and purpose. Gumprecht v. City of Coeur d'Alene, 104 Idaho 615, 661 P.2d 1214 (1983). A statute will be interpreted reasonably in order to give effect to the legislative intent. State v. Rawson, 100 Idaho 308, 597 P.2d 31 (1979). We believe that, by enacting I.C. § 16-1806A, the legislature clearly intended certain violent criminal acts, when committed by minors, should be excluded from YRA jurisdiction. The statute, reasonably interpreted, applies to persons who are age fourteen years to age eighteen years at the time the act is committed. Accordingly, like I.C. § 18-216 and I.C. § 16-1803, the applicability of section 16-1806A turns on the age of the person at the time the crime is committed. Because the statutes are triggered at the same instant, no lapse occurs between the time of the criminal conduct and the application of section 16-1806A. Anderson's conduct was excepted from YRA jurisdiction at its occurrence; he had no statutory right to be proceeded against as a minor. Anderson acquired no expectation, from either legislation or state conduct furthering prosecution of the crime, that he would be charged in juvenile court.[2] Accordingly, his right to due process was not infringed when he was charged with a crime excluded from YRA jurisdiction.
Anderson also argues that section 16-1806A violates the due process clause by creating an irrebutable presumption regarding his ability to be rehabilitated. The state's primary interest in dealing with most minor offenders is rehabilitation rather than punishment. See State v. Gibbs, 94 Idaho 908, 500 P.2d 209 (1972). Anderson believes section 16-1806A, by excepting his conduct from YRA jurisdiction, in effect creates an irrebutable presumption that he cannot be rehabilitated. He argues that such a presumption, by foreclosing his opportunity to demonstrate a rehabilitative character, infringes upon rights guaranteed by the due process clause. We are not persuaded. The cases cited by Anderson  Vlandis v. Kline, 412 U.S. 441, 93 S.Ct. 2230, 37 L.Ed.2d 63 (1973) and United States Department of Agriculture v. Murry, 413 U.S. 508, 93 S.Ct. 2832, 37 L.Ed.2d 767 (1973)  do not support his proposition. In Vlandis, a Connecticut statute prevented certain students from proving their residency, making them ineligible for the favored registration status granted to state residents attending colleges and universities. The plaintiff in Murry attacked a provision of the 1964 Food Stamp Act that denied food stamps to anyone claimed as a dependent on another's income tax filing. The presumptions created in Vlandis and Murry prevented the plaintiffs from demonstrating their eligibility for an advantaged *80 position granted to them by a government entity. As we have already discussed, Anderson never was entitled in this case to the advantaged position granted to those within the purview of the YRA. A demonstration by Anderson that he can be rehabilitated would not entitle him to a YRA proceeding. We find no infringement of the rights accorded Anderson under the due process clause.
Nor are we convinced that section 16-1806A violates the fourteenth amendment's equal protection clause. The United States Supreme Court in McGown v. Maryland, 366 U.S. 420, 81 S.Ct. 1101, 6 L.Ed.2d 395 (1961), stated the standard for testing this type of equal protection violation claim:
Although no precise formula has been developed, the court has held that the fourteenth amendment permits the states a wide scope of discretion in enacting laws which affect some groups of citizens differently than others. The constitutional safeguard is offended only if the classification rests on grounds wholely irrelevant to the achievement of the state's objective. State legislatures are presumed to have acted within their constitutional power despite the fact that, in practice, their laws result in some inequality. A statutory discrimination will not be set aside if any state of facts reasonably may be conceived to justify it. (Citations omitted.)
366 U.S. at 425-26, 81 S.Ct. at 1105. Other courts have upheld legislation similar to I.C. § 16-1806A in the face of an equal protection challenge. See e.g., Woodard v. Wainwright, 556 F.2d 781 (5th Cir.1977), cert. denied 434 U.S. 1088, 98 S.Ct. 1285, 55 L.Ed.2d 794; United States v. Bland, 472 F.2d 1329 (D.C. Cir.1972); State v. Sherk, 217 Kan. 726, 538 P.2d 1399 (1975); State ex rel. Coats v. Rakestraw, 610 P.2d 256 (Okla. App. 1980); State v. Doe, 91 N.M. 506, 576 P.2d 1137 (N.M.App. 1978). Anderson has not demonstrated that the classification created by the legislature is wholely irrelevant to the achievement of the state's objective. We believe the classification bears a rational relationship to an important legislative objective.

B
Next, Anderson contends section 16-1806A irreconcilably conflicts with I.C. § 16-1804 and that the latter section, which provides for transfer of a case to juvenile court, controls the jurisdiction issue. Because rules of statutory construction favor the latest enactment when legislation conflicts, Jordan v. Pearce, 91 Idaho 687, 429 P.2d 419 (1967), and because section 16-1804 was amended after section 16-1806A was enacted, Anderson suggests that section 16-1804 in effect repeals section 16-1806A and thus controls the jurisdiction issue. However, "where earlier and later acts are not necessarily in conflict and may be reconciled by reasonable construction no repeal will result." County of Ada v. State, 93 Idaho 830, 831, 475 P.2d 367, 368 (1970). Section 16-1804 must be viewed as operative only when the juvenile court has jurisdiction to proceed and, because section 16-1806A excludes certain crimes ab initio from juvenile court jurisdiction, section 16-1804 is not applicable to those cases coming within section 16-1806A. Thus, we believe a reasonable construction of the statutes eliminates the conflict suggested by Anderson.

II
Anderson also challenges his sentence, contending it is excessive. He believes the twenty-one year indeterminate sentence amounts to an abuse of discretion because the sentencing judge did not give sufficient weight to Anderson's age or to the motivation that incarceration in the Ada County Jail had on his conduct. He points to evidence presented at the sentencing hearing demonstrating that Anderson is not a pathological criminal or a threat to society and that a lengthy prison term would be psychologically harmful to him. Anderson believes these mitigating factors, if considered fully by the sentencing judge, should have resulted in a lesser sentence than the one imposed.
*81 The sentence to be imposed following a criminal conviction is within the discretion of the trial court. State v. Cotton, 100 Idaho 573, 602 P.2d 71 (1979). Ordinarily, a sentence within the maximum allowed by statute will not be considered an abuse of discretion, Id., but an abuse of discretion occurs if the sentence is unreasonable. State v. Toohill, 103 Idaho 565, 650 P.2d 707 (Ct.App. 1982). A sentence of confinement is unreasonable if it is longer than is necessary to accomplish the primary objective of protecting society and to achieve any or all of the related goals of deterrence, rehabilitation and retribution. Id. Because the period of actual confinement under an indeterminate sentence is decided by the commission of pardons and parole, for the purpose of appellate review we deem one-third of the indeterminate sentence to be an appropriate measure of the term of confinement. Id. Thus, in reviewing Anderson's sentence, we consider whether confinement for seven years amounts to an abuse of sentencing discretion.
The record of the sentencing hearing indicates the judge diligently considered the mitigating factors presented by Anderson. The sentencing judge was mindful of the harsh environment of the jail cell; the judge characterized that environment as "austere, brutal" and one "where macho toughness was the rule of law and violence was a way of life." The judge also considered the senseless, brutal nature of the crime and the fatal effect on the victim. Although protecting society from Anderson's future criminal conduct was not of paramount concern, the sentencing judge believed retribution, deterrence and rehabilitation all would be furthered by imposition of the indeterminate sentence. Anderson has not shown that, "under any reasonable view of the facts, his sentence was excessive... ." State v. Toohill, 103 Idaho at 568, 650 P.2d at 710.
Anderson strenuously argues that his conduct is less culpable, justifying a lighter sentence, because of the environment in which the beating of Peterman occurred. He points out that six adolescents, some with aggressive dispositions, were placed in a small holding cell. He contends the youths were unsupervised, had no access to radio or television, had only minimal access to an exercise yard, and had nothing else to provide mental or physical diversion. We agree with Anderson that the circumstances surrounding criminal conduct should be considered, as they were here, when determining an appropriate sentence. We do not agree, however, that the circumstances in this case justify ignoring the principle of personal responsibility which underlies our criminal justice system. Boredom does not excuse a brutal crime.
The judgment of conviction and the sentence are affirmed.
SWANSTROM, J., concurs.
BURNETT, J., joins in Part I-B of the Court's opinion and concurs in the result with respect to Parts I-A and II.
NOTES
[1]  The term "juvenile court" as used in this opinion simply means a judge, usually a magistrate, sitting to hear proceedings under the Youth Rehabilitation Act, I.C. §§ 16-1801 to -1845.
[2]  This is not a case where the state first proceeded against the accused as a minor and subsequently sought prosecution of the accused as an adult. It is established that relinquishment of juvenile court jurisdiction in such a case must be pursuant to procedures mandated by the due process clause. See Kent v. United States, 383 U.S. 541, 86 S.Ct. 1045, 16 L.Ed.2d 84 (1966); State v. Gibbs, 94 Idaho 908, 500 P.2d 209 (1972).
