
789 P.2d 221 (1990)
CITY OF BILLINGS, Plaintiff and Respondent,
v.
Thomas LAYZELL, Defendant and Appellant.
No. 89-328.
Supreme Court of Montana.
Submitted on Briefs October 13, 1989.
Decided March 13, 1990.
Rehearing Denied May 1, 1990.
*222 Thomas Layzell, Missoula, pro se.
Russell Fagg, City Atty., Billings, for plaintiff and respondent.
TURNAGE, Chief Justice.
Thomas Layzell appeals his conviction and sentence following a jury trial in the Billings City Court and a de novo bench trial in the Thirteenth Judicial District Court, Yellowstone County, for failure to obey a stop sign and failure to obey a red light. We affirm in part and reverse in part.

ISSUES
Though the appellant's pro se brief is less than pellucid as to the issues on appeal, the following is a fair representation of the questions presented by his arguments.
1. Does the record contain sufficient evidence to uphold the appellant's conviction for disobeying a traffic control signal and disobeying a stop sign?
2. Did the City Court violate the appellant's right to freedom from excessive bail under U.S. Const. amend. VIII and Art. II, Sec. 22, Mont. Const., by knowingly setting bail in excess of appellant's ability to pay?
3. Did the City Court punish the appellant in violation of his due process and equal protection rights under U.S. Const. amend. XIV, § 1, and Art. II, Secs. 4 and 17, Mont. Const., by setting bail which guaranteed pretrial detention and a trial date for sixty-five days after arrest?
4. Did the City Court and District Court violate the indigent appellant's right to counsel under U.S. Const. amend. VI, and Art. II, Sec. 24, Mont. Const., by refusing to appoint counsel even though the appellant spent thirty days in pretrial detention?
5. Did the District Court err in failing to credit thirty days of pretrial detention against the appellant's sentence as required by § 46-18-403(2), MCA (1987)?

FACTS
Billings police ticketed Thomas Layzell on February 11, 1987, for failure to observe a traffic light. He refused to appear before Billings City Court Judge Donald E. Bjertness and was arrested on November 27. The City Court released Layzell with an order to appear on December 4 but he again failed to comply. On January 5, 1988, Billings police issued Layzell a second ticket for rolling through a stop sign. Layzell again refused to present himself to the court, and, on March 28, 1988, city police arrested him on warrants for both tickets.
As a result of his arrest, Layzell faced two months of incarceration in the Yellowstone County Detention Facility without *223 having been convicted of any crime and without representation by an attorney. On Layzell's arrest, the City Court set bail at $300, knowing that Layzell had only $47. The court then calendared trial for May 31, 1988, sixty-five days after arrest. The court denied Layzell's request for court-appointed counsel reasoning that the traffic offenses would not result in a jail term. The court also denied Layzell's several requests for reduced bail.
Layzell contends that the pretrial incarceration had a disastrous effect on his life. He states that he lost the only job he had been offered for a long while. As a result, he faced eviction from his apartment and confiscation of his personal property. Out of desperation he went on a hunger strike.
After thirty days in jail, Layzell obtained the help of Montana Legal Services and filed a writ of habeas corpus in state district court. During the hearing on April 26, the city prosecutor informed Layzell that his trial had been advanced thirty days to May 3. The habeas corpus court heard the parties' testimony and ordered Layzell's immediate release on his own recognizance.
Trial on the traffic tickets was held before a six-person, city court jury. The jury found Layzell guilty on both counts, and the court imposed the maximum fine of $300 plus $256 in court costs. Layzell appealed to the District Court for a de novo bench trial. The District Court denied his request for a court-appointed attorney and found him guilty on both counts. The court fined Layzell $100 on each count plus a $10 surcharge.

THE TRAFFIC TICKETS
The appellant disputes the testimony on which he was convicted. In criminal cases,
[o]ur standard of review when presented with a challenge to the sufficiency of the evidence is whether, after viewing the evidence in the light most favorable to the prosecution, any rational trier of fact could have found the essential elements of the crime beyond a reasonable doubt.
State v. McDonald (1987), 226 Mont. 208, 210, 734 P.2d 1216, 1217 (citation and quotations deleted).
The police officers who issued the traffic tickets testified that they were present during the violations and ticketed Layzell after observing his failure to stop for the traffic signal and stop sign. While Layzell may disagree with the officers' testimony, a rational trier of fact could have relied on their statements in finding him guilty.

EXCESSIVE BAIL
That bail may not be excessive is a fundamental, constitutional principle. U.S. Const. amend. VIII; Art. II, Sec. 22, Mont. Const. To insure that bail is not excessive, the Montana courts are constrained in setting bail by the eleven factors listed in § 46-9-301, MCA. Within these restrictions, the amount of bail is left to the sound discretion of the trial court and will be upheld if reasonable. State v. Lance (1986), 222 Mont. 92, 105, 721 P.2d 1258, 1267.
A $300 bail for these two traffic offenses is not excessive in the present circumstances; it equals the maximum allowable fine. See § 61-8-711(2), MCA. The record indicates that the City Court had sufficient reason to believe that Layzell would not appear for trial. Three times Layzell failed to appear in City Court to answer these same charges. Layzell had no substantial ties to the community; he owned no property, was unemployed, and had few friends and no relatives in Montana. When arrested he told the City Court in forceful language that he believed the charges were spurious.

PRETRIAL PUNISHMENT
The appellant is correct in asserting that the City Court may not set bail which effectively guarantees pretrial detention as a means of punishing an indigent defendant. The purpose of bail is to honor the presumption of innocence while ensuring the defendant's presence at trial. Section 46-9-101, MCA; Bell v. Wolfish (1979), 441 U.S. 520, 536-37, 99 S.Ct. 1861, *224 1872-73, 60 L.Ed.2d 447, 467; State v. Seybert (1987), 229 Mont. 183, 185, 745 P.2d 687, 688. To punish a defendant prior to an adjudication of guilt is a violation of his right to due process. Bell, 441 U.S. at 535, 99 S.Ct. at 1872, 60 L.Ed.2d at 466. To incarcerate a defendant solely because of his indigence is a violation of the defendant's right to equal protection. See Tate v. Short (1971), 401 U.S. 395, 398-99, 91 S.Ct. 668, 671, 28 L.Ed.2d 130, 133.
The courts have long recognized the tension between the criminal defendant's right not to be punished prior to an adjudication of guilt and the state's interest in assuring a criminal defendant's presence at trial. The framers of our constitutions attempted to balance these conflicting interests by providing a right to reasonable bail. That balance, however, becomes difficult to maintain when the rights of indigent defendants are placed on the scales. Justice William O. Douglas has spoken eloquently on this dilemma when considering the right to bail pending appeal:
This traditional right to freedom during trial and pending judicial review has to be squared with the possibility that the defendant may flee or hide himself. Bail is the device which we have borrowed to reconcile these conflicting interests. The purpose of bail is to insure the defendant's appearance and submission to the judgment of the court. It is assumed that the threat of forfeiture of one's goods will be an effective deterrent to the temptation to break the conditions of one's release.
But this theory is based on the assumption that a defendant has property. To continue to demand a substantial bond which the defendant is unable to secure raises considerable problems for the equal administration of the law. We have held that an indigent defendant is denied equal protection of the law if he is denied an appeal on equal terms with other defendants, solely because of his indigence. Can an indigent be denied freedom, where a wealthy man would not, because he does not happen to have enough property to pledge for his freedom?
It would be unconstitutional to fix excessive bail to assure that a defendant will not gain his freedom. Yet, in the case of an indigent defendant, the fixing of bail in even a modest amount may have the practical effect of denying him release. The wrong done by denying release is not limited to the denial of freedom alone. That denial may have other consequences. In the case of reversal, he will have served all or part of a sentence under an erroneous judgment. Imprisoned, a man may have no opportunity to investigate his case, to cooperate with his counsel, to earn the money that is still necessary for the fullest use of his right to appeal.
Bandy v. United States (1960), 81 S.Ct. 197, 197-98, 5 L.Ed.2d 218.
In some cases, Justice Douglas's "other consequences" may precipitate a spiraling burden on both the defendant and the state. The defendant who is held in pretrial detention because he is indigent loses any opportunity for gainful employment. Because he cannot earn money, he cannot pay his fines or his bills. He may lose whatever property he owns in inadequate attempts to satisfy creditors. When he is in jail, the state must bear the cost of maintenance and detention. When he is released, he may become an even greater burden on the state's social services. It is difficult to see how the state's interest in prosecuting two traffic tickets outweighs the burden imposed on the state and on the defendant by pretrial detention.
Though not addressing the issue of pretrial detention on failure to make bail, the United States Supreme Court has held that a state's interest in collecting traffic fines does not outweigh the equal protection rights of indigents. In Williams v. Illinois, the Supreme Court struck down the application of an Illinois statute which required indigents to work off fines for petty theft at $5.00 per day when the resulting incarceration exceeded the maximum permissible jail sentence under the state's petty theft statutes. Williams (1970), 399 *225 U.S. 235, 242, 90 S.Ct. 2018, 2023, 26 L.Ed.2d 586, 593-94. In Tate v. Short, the Court relied on Williams to strike down a Texas statute which required indigents to work off traffic fines through incarceration at a municipal prison farm even though the substantive traffic statutes did not allow jail sentences. Tate (1971), 401 U.S. 395, 397, 91 S.Ct. 668, 670, 28 L.Ed.2d 130, 133. The principle in Williams and Tate is the same; incarceration solely on the basis of indigence is unconstitutional. If equal protection for indigents applies to defendants convicted of a crime, it should also apply to indigents who have not been found guilty of anything. See Allen v. Burke (E.D.Va. June 4, 1981), No. 81-0040 Civ. 28, 1981 WL 15186.
The rule of Williams and Tate will not prevent incarceration of indigents in every case. A court may have no reasonable alternative to detaining defendants who cannot make bail. Williams and Tate, however, place a heavy burden on the court to search for the least oppressive means.
The present record indicates that City Court Judge Bjertness not only failed to look for the least oppressive means, but instead used the opportunity in a wholly inappropriate exercise of judicial power to punish the appellant. Having determined that Layzell would not make bail, the court set an excessively late trial date, in effect sentencing the appellant to a sixty-five-day jail term prior to conviction for any crime. We are aware of the busy calendars faced by the municipal courts. However, we find it incredible that in over two months the court could find no time in which to try these simple traffic violations. We note the remarkable coincidence between Layzell filing habeas corpus proceedings on April 22 and three days later the City Court's sudden discovery of an opening in its calendar. Even the one month Layzell actually spent in jail is inexcusably excessive.
We are aware that Layzell made the City Court's task difficult. He refused to appear for trial, provoked the court with verbal abuse, and generally resisted reasonable and expeditious settlement of the charges. Obstinance, however, is not a waiver of constitutional rights. If anything, it is a warning that increased vigilance is required. It most definitely is not justification for the use of judicial power to incarcerate the appellant at the court's personal whim.
We would overturn Layzell's conviction but for one reason; during the entire duration of his incarceration, Layzell held the keys to his own cell. At the habeas corpus hearing, Layzell testified that he never inquired into the possibility of satisfying his bail through any friend, relative or surety company. Lt. Ross, commander of the detention facility, testified that Layzell could have obtained a sufficient surety bond for $50. When arrested, Layzell had $47 and change. By failing to even attempt to procure the difference, Layzell assured his continued incarceration. In technical terms, Layzell lacks standing to challenge the constitutionality of the City Court's acts because his own unwillingness to borrow three dollars caused his injury.
The recalcitrance of both the appellant and the City Court transformed these two routine traffic tickets into significant constitutional questions. Layzell acted with the apparent intention of provoking the City Court into violating his constitutional rights. The court played into Layzell's hands by using pretrial detention as punishment. While we soundly condemn the court's actions, we will not find a constitutional violation when the appellant intentionally created and prolonged the incident.

APPOINTMENT OF COUNSEL
Montana law gives the courts discretion to appoint counsel for indigent, misdemeanor defendants when appointment would serve the interests of justice. Section 46-8-101(3), MCA. That discretion is restricted to defendants who will not lose their physical liberty. See State v. City Court of Billings (1982), 203 Mont. 443, 453, 662 P.2d 276, 281. When the statute under which the defendant is convicted provides for incarceration, refusal to appoint counsel precludes imposition of a jail sentence. Scott v. Illinois (1979), 440 U.S. *226 367, 373-74, 99 S.Ct. 1158, 1162, 59 L.Ed.2d 383, 389.
Here the City Court and District Court denied a court-appointed attorney on the grounds that Layzell would not be sentenced to jail. The courts complied with this restriction by imposing only fines. Nothing in their decisions violates the restrictions under which appointment of counsel may be refused.
Layzell argues that the time he spent in jail awaiting trial deprived him of his liberty, thereby requiring court-appointed counsel. This Court and the United States Supreme Court have not yet recognized a right to counsel solely on the basis of pretrial incarceration. Because the appellant could have ended that incarceration, we decline to establish a new constitutional rule in this case.

CREDIT FOR TIME SERVED
Layzell also argues that the District Court's failure to credit his thirty days of pretrial detention against his $200 fine was a violation of his constitutional rights. The United States Supreme Court has not yet addressed this issue. The federal courts are greatly divided over whether, and in what circumstances, Williams and Tate give indigents a constitutional right to credit for pretrial detention. See Johnson v. Riveland (10th Cir.1988), 855 F.2d 1477, 1483-84 n. 7 (collecting cases). We do not find it necessary to decide this difficult issue in the present case. The District Court's failure to comply with the Montana statutes is sufficient to reverse the appellant's sentence.
The Montana statute in effect at the time provided:
Any person incarcerated on a bailable offense who does not supply bail and against whom a fine is levied on conviction of such offense shall be allowed a credit of $10 for each day so incarcerated prior to conviction, except that in no case shall the amount so allowed or credited exceed the amount of the fine.
Section 46-18-403(2), MCA (1987) (emphasis added).
The statutory language is mandatory. It requires the District Court to give credit for pretrial detention accrued because the defendant did not make bail. Layzell's thirty-day pretrial detention is more than sufficient to discharge his fine.
We affirm the traffic convictions, reverse the sentence, and remand for resentencing in accordance with this opinion.
HUNT, SHEEHY, McDONOUGH and BARZ, JJ., concur.
