
503 P.2d 1403 (1972)
Louis D. COSCO, Appellant (Defendant below),
v.
The STATE of Wyoming, Appellee (Plaintiff below).
No. 4131.
Supreme Court of Wyoming.
December 14, 1972.
*1404 Louis D. Cosco, pro se.
Clarence A. Brimmer, Atty. Gen., Bert T. Ahlstrom, Jr., Asst. Atty. Gen., Cheyenne, for appellee.
Before McINTYRE, C.J., and PARKER, McEWAN and GUTHRIE, JJ.
Chief Justice McINTYRE delivered the opinion of the court.
James C. Smith, a guard at the Wyoming State Penitentiary, was severely beaten by two inmates. Louis D. Cosco, one of the two inmates, was charged and convicted by a jury of aggravated assault and battery with a dangerous weapon. He has appealed such conviction from the district court to our court.
Several questions are raised by appellant relative to procedures concerning the defendant's insanity pleas. First, it is suggested the trial court should have ordered a current psychiatric examination of defendant. The record discloses, however, that the accused was given a psychiatric evaluation after insanity pleas were made at arraignment. This made the third recent evaluation. All three determined that Cosco was triable and that he knew what he was doing when the offense was committed.
There is nothing to indicate another psychiatrist might say anything different.[1]
The second question raised in regard to the insanity pleas is whether it was error for the defendant to be compelled to defend himself without a ruling that he *1405 was competent to do so. Of course the psychiatrist had determined the defendant was capable of assisting in his own defense; and the judge in effect ruled on the ability of the accused to defend himself when the judge denied defense motions pertaining to further psychiatric evaluation.
The third suggestion relative to insanity is that the trial court should not have permitted the defendant to discharge his attorneys. The record indicates Cosco managed to have five separate attorneys appointed to represent him and in addition had assistance from the Wyoming Defender Aid Program at the University of Wyoming.
The record further shows that Cosco had successfully moved for a bifurcated trial. After the jury returned a verdict of guilty of aggravated assault and battery with a dangerous weapon, the defendant decided to waive trial on the various insanity issues. At that time he was fully and ably represented by counsel.
It could be claimed that a judge was exceeding his authority if he acted affirmatively to prevent a defendant from discharging his attorneys when the defendant wished to do so. In this instance, it is entirely possible Cosco would now be alleging error if the trial judge had prevented him from discharging his attorneys.
Finally, it is suggested the district court should not have permitted Cosco to withdraw his plea of present incompetency without ruling on his competency to withdraw such plea. We have already pointed out that defendant was adequately represented by counsel when he withdrew his insanity pleas. Moreover, the matter of permitting a defendant to withdraw his plea of not guilty and enter a plea of guilty is within the discretion of the trial court.[2]

Speedy Trial
Appellant claims his constitutional rights were violated because there was a delay of 19 months before his trial. The state responds by saying the delay was not solely attributable to the prosecution and the lapse was not prejudicial to defendant.
We cannot disagree with the authority cited by appellant for the proposition that there is a constitutional right to a speedy trial. The question to be decided is whether there were unnecessary delays in affording the accused a trial. As recently indicated in Barker v. Wingo, 407 U.S. 514, 92 S.Ct. 2182, 2192, 33 L.Ed.2d 101 (1972), each case must be determined on its own peculiar facts and circumstances; and factors to be considered are: length of delay, the reason for delay, the defendant's assertion of his right, and prejudice to the defendant.
The record in this case indicates these things:
1. The defendant's insanity pleas necessitated a psychiatric examination which took time.
2. The defendant brought a civil action against the Warden of the penitentiary and that had to be disposed of before trial could be set for the criminal case.
3. The defendant filed numerous motions and other pleadings which necessitated full-scale hearings and delayed the setting of trial.
4. The defendant had several changes of attorneys, as we have previously indicated, and this caused delays.
5. Although appellant asserts he did not ask for a delay, the record reveals no request on his part for an earlier trial and we failed to find anything in the record indicating any unreasonable delay attributable to the prosecution.
6. As we will explain in the next succeeding paragraph, it is our judgment *1406 that the defendant was not prejudiced by any delay in his trial.
At the time Cosco was alleged to have attacked a guard, he was serving four consecutive life sentences in the penitentiary, with no chance of parole. For the aggravated assault and battery with a dangerous weapon conviction, he was sentenced to serve not less than eight nor more than ten years in the Wyoming State Penitentiary, to be served concurrently with the four life sentences. We consider that an appealing litigant who claims prejudicial error has the burden of establishing prejudice. Robertson v. State Highway Commission, Wyo., 450 P.2d 1003, 1004-1005. In this case, we fail to see where Cosco was prejudiced by a delay in trial.
It is suggested two witnesses left the penitentiary and the state before Cosco's trial was had. The parties named, however, were not eyewitnesses to the actual assault and there is no showing that they could have testified to anything vital or material to the defendant's defense. Also, it is apparent that no effort was made to inform the court of a desire to obtain their testimony before they left the penitentiary and state.
James C. Smith, the complaining witness, died within 60 days after the beating. Appellant suggests he was prejudiced on account of Smith being unavailable to testify. This particular case could not have been ready for trial before Smith's death and the state was not responsible for that  the rights of the accused were being protected as we have previously indicated. Moreover, it is reasonable to believe the death of Smith may have handicapped the prosecution as much or more than it did the defendant.
It seems to be well settled in the law that action or inaction on the part of the accused resulting in delay, including dilatory pleas, motions or proceedings, may comprise a waiver of his right to a speedy trial.[3] Under all the circumstances of this case, as reflected by the record, we are sure the delays which did occur in trial were mostly for the benefit of or caused by the defendant and that the defendant was not prejudiced or denied a speedy trial within the meaning of constitutional provisions.

Ex Post Facto
There is a suggestion that appellant is the victim of an ex post facto law because the legislature, after the beating of Smith, passed a law clarifying the fact that a convict who has made an assault with a deadly weapon upon an officer or employee of an institution shall not be eligible for parole.
Of course the amendment referred to has nothing to do with the guilt or innocence of Cosco. He was charged and convicted under a statute which has existed without change for several years. If the amended statute complained of ever comes into question in connection with a parole for Cosco, it will then be time enough to question whether it can have a retroactive effect. As of now, Cosco is not eligible for parole under laws existing prior to the questioned amendment.

Suppression of Evidence
Another suggestion made by appellant is that the state suppressed evidence because penitentiary authorities did not permit a letter from an inmate, John J. McDaniel, to be mailed to Cosco's Defender Aid attorney. The letter stated McDaniel was a witness for Cosco.
It is clear McDaniel's letter was not mailed because a rule of the penitentiary *1407 does not permit an inmate to write using the name of another inmate or saying things about another inmate. The record discloses that no evidence was suppressed, however, because the letter incident was five weeks before Cosco's trial and Cosco knew several months before trial that McDaniel was claiming to have been a witness to part of the affair between Cosco and Smith. Also, several months before trial Cosco listed the names of witnesses in a letter to the district court clerk, requesting subpoenas for them. McDaniel was named as one of the witnesses.
All things considered, the trial court was entitled to believe there had been no suppression of evidence by the prosecution. We concur in that belief. If appellant's trial attorneys had thought the testimony of McDaniel was important to Cosco's defense, McDaniel doubtless would have been called. The record does not indicate the use of McDaniel as a witness was prevented by the prosecution.
We find no reversible error in the record and conclude the conviction and sentence for aggravated assault and battery with a dangerous weapon must be affirmed.

Habeas Corpus
In addition to appellant's appeal in this case, he has separately filed a petition for writ of habeas corpus, alleging that he is illegally restrained of his liberty by the Warden of the Wyoming State Penitentiary. At the request of Cosco, we have heretofore consolidated his appeal and his petition for habeas corpus into a single hearing.
Section 1-810, W.S. 1957, requires, among other things, that a petition for a writ of habeas corpus must show that the person on whose behalf the writ is sought is restrained of his liberty; and that the restraint is illegal. It is quite apparent from the record in this case that Cosco is legally restrained, not only by virtue of his four consecutive life sentences but also by virtue of the additional sentence for aggravated assault and battery with a dangerous weapon.
The judgment appealed from is affirmed and applicant's petition for writ of habeas corpus is denied.
NOTES
[1]  Authority for the trial court's failure to order, at state expense, further psychiatric examinations of the defendant is found in the annotation in 32 A.L.R.2d 434, 456.
[2]  State ex rel., Conway v. Blake, 5 Wyo. 107, 38 P. 354, 357; 110 A.L.R. 1300; Lucero v. People, 164 Colo. 247, 434 P.2d 128, 130; United States v. Kimbrew, 6 Cir., 380 F.2d 538, 540.
[3]  See Bradford v. United States, 5 Cir., 413 F.2d 467, 469-470; United States v. Skillman, 8 Cir., 442 F.2d 542, 556-557; United States v. Fitzpatrick, 2 Cir., 437 F.2d 19, 26-27; Barker v. Wingo, 407 U.S. 514, 92 S.Ct. 2182, 2188, 2192, 33 L.Ed.2d 101; United States v. Marion (U.S.Dist.Colo.), 404 U.S. 307, 92 S.Ct. 455, 466, 30 L.Ed.2d 468; Hughes v. State, 228 Ga. 593, 187 S.E.2d 135, 136-137; and Favors v. Eyman, 9 Cir., 466 F.2d 1325, 1327-1328.
