
399 So.2d 481 (1981)
Albert John MYLES, Jr., Appellant,
v.
The STATE of Florida, Appellee.
No. 78-1957.
District Court of Appeal of Florida, Third District.
June 9, 1981.
*482 Bennett H. Brummer, Public Defender and John H. Lipinski, Sp. Asst. Public Defender, for appellant.
Jim Smith, Atty. Gen. and Calvin L. Fox, Asst. Atty. Gen., for appellee.
Before HENDRY, SCHWARTZ and FERGUSON, JJ.
FERGUSON, Judge.
After jury conviction for crimes committed in March, 1978, John Myles, Jr. was sentenced to consecutive sentences of ninety-nine years in the state penitentiary for second-degree murder and to thirty years for involuntary sexual battery. The trial judge elected to retain jurisdiction pursuant to Section 947.16(3), Florida Statutes (1979) (originally enacted in 1977 and made effective June 1978). Myles appeals.
The trial court's retention of jurisdiction under Section 947.16, constitutes an ex post facto application of the statute because this law attaches legal consequences to crimes which Myles committed before the law took effect and affects him in a disadvantageous fashion by in effect extending his jail time. State v. Williams, 397 So.2d 663 (Fla. 1981).
The remaining issue dispositive of this appeal is whether Myles' confession was voluntary and properly entered into evidence or whether the statement should have been suppressed as a matter of law because Myles was of limited intelligence and functionally illiterate rendering him mentally incompetent to knowingly and intelligently waive his Miranda rights.[1]
Although mental capacity may be considered in determining whether under the totality of circumstances a confession is voluntary, State v. Chorpenning, 294 So.2d 54 (Fla. 2d DCA 1974), the lack of mental capacity is generally considered only as it relates to credibility and not admissibility, see, e.g., Palmes v. State, 397 So.2d 648 (Fla. 1981); Reddish v. State, 167 So.2d 858 (Fla. 1964), and a confession will not be excluded on these grounds where it is shown that the defendant understands his rights, see, e.g., Ashley v. State, 370 So.2d 1191 (Fla. 3d DCA 1979); Lane v. State, 353 So.2d 194 (Fla. 3d DCA 1977).
Here there is no question that Myles was read his Miranda rights. There is sufficient evidence to justify the finding of the trial court that Myles knowingly waived these rights. Even though Myles had the literary level of a first grader, he was found to be of borderline intelligence. The doctor hired by the defense to evaluate Myles testified that Myles was emotionally, psychologically, and intellectually competent to make a free and knowing waiver of his rights. Myles was not a juvenile, nor do we find any evidence in the record which would justify reversing the decision of the trial court. See, e.g., State v. Riocabo, 372 So.2d 126 (Fla. 3d DCA 1979), dismissed, 378 So.2d 348 (Fla. 1979). To the contrary, the record demonstrates that the State met its burden of proving that Myles' statement was voluntary.
*483 We reverse with respect to retention of jurisdiction over the offender, affirm the conviction, and remand for correction of the sentence in accordance with this opinion.
NOTES
[1]  We note that the issue of voluntariness is reached here because Myles was in custody, was interrogated by the police and had been given the Miranda warnings.
