
302 S.C. 169 (1990)
394 S.E.2d 486
THE STATE, Respondent
v.
Randall HUIETT, Appellant.
23241
Supreme Court of South Carolina.
Heard May 9, 1990.
Decided July 23, 1990.
Asst. Appellate Defenders Joseph L. Savitz, III and Robert M. Pachak, of S.C. Office of Appellate Defense, Columbia, for appellant.
Atty. Gen. T. Travis Medlock, Asst. Atty. Gen. Harold M. Coombs, Jr., and Staff Atty. Miller W. Shealy, Jr., and Sol. James C. Anders, Columbia, for respondent.
Heard May 9, 1990.
Decided July 23, 1990.
*170 HARWELL, Justice:
This case involves the issue of whether the trial judge erred in committing appellant Randall Huiett to the South Carolina State Hospital pursuant to S.C. Code Ann. § 17-24-40 (1976), which was enacted in 1984. Appellant argues that the application of Section 17-24-40, constituted a violation of the prohibition against ex post facto laws as it was enacted after appellant committed the offense for which he was charged.
Appellant Randall Huiett was indicted in 1977 for the October 28, 1976 ax-murder of a dairy worker. Appellant's first trial on May 4 and 5, 1977, ended in a mistrial. On May 11 and 12, 1977, appellant was retried and convicted of murder despite his defense of insanity. This Court reversed and remanded the case.[1] Upon remand and in a subsequent proceeding, appellant was then found not guilty by reason of insanity after a bench trial held on February 28, 1989. The trial judge then committed appellant to the South Carolina State Hospital for a 120-day evaluation pursuant to S.C. Code Ann. § 17-24-40 (1976). This appeal follows.

DISCUSSION
Appellant asserts that the trial judge erred in committing him to the South Carolina State Hospital pursuant to Section 17-24-40 which was enacted in 1984. Appellant argues that the trial judge should have applied S.C. Code Ann. § 44-23-610 (1976) which sets forth the standards for commitment of persons acquitted by reason of insanity and was the law in effect at the time of the offense.[2] Appellant submits that the *171 retroactive application of Section 17-24-40 disadvantaged him and constituted a violation of the prohibition against ex post facto laws as set forth in S.C. Const. art. I, § 4 and in U.S. Const. art. I, § 10.
It has been held that an ex post facto law "is an enactment, criminal or penal in nature, which is retrospective and disadvantages the offender affected by it." United States v. Mest, 789 F. (2d) 1069, 1071 (4th Cir.1986); Weaver v. Graham, 450 U.S. 24, 101 S.Ct. 960, 67 L.Ed. (2d) 17 (1981). As early as 1798, the United States Supreme Court set forth what constitutes an ex post facto law in Calder v. Bull, 3 U.S. (3 Dall.) 386, 390, 1 L.Ed. 648, 650 (1798):
1st. Every law that makes an action done before the passing of the law; and which was innocent when done, criminal; and punishes such action. 2d. Every law that aggravates a crime, or makes it greater than it was, when committed. 3d. Every law that changes the punishment, and inflicts a greater punishment, than the law annexed to the crime, when committed. 4th. Every law that alters the legal rules of evidence, and receives less, or different, testimony, than the law required at the time of the commission of the offense, in order to convict the offender.
The purpose of an ex post facto clause is to "assure that federal and state legislatures [are] restrained from enacting arbitrary or vindictive legislation" and that "legislative enactments `give fair warning of their effect and permit individuals to rely on their meaning until explicitly changed.' " Miller v. Florida, 482 U.S. 423, 429-430, 107 S.Ct. 2446, 2451, 96 L.Ed. (2d) 351, 359 (1987) (citations omitted). Therefore, in order for a law to fall within the ex post facto prohibition, two critical elements must be present: (1) the law must be retrospective so as to apply to events occurring before its enactment, and (2) the law must disadvantage the offender affected by it. Miller v. Florida, supra.
No ex post facto violation occurs if a change does not alter "`substantial personal rights,' but merely changes `modes of procedure which do not affect matters of substance.'" Miller v. Florida, 482 U.S. at 430, 107 S.Ct. at 2451, 96 L.Ed. (2d) at 360 (citations omitted). Even *172 though a procedural change may have a detrimental impact on a defendant, a mere procedural change which does not affect substantial rights is not ex post facto. Dobbert v. Florida, 432 U.S. 282, 97 S.Ct. 2290, 53 L.Ed. (2d) 344 (1977). Further, in order for the ex post facto clause to be applicable, the statute or the provision in question must be criminal or penal in purpose and nature. Flemming v. Nestor, 363 U.S. 603, 80 S.Ct. 1367, 4 L.Ed. (2d) 1435 (1960).
In order to determine whether the trial judge's application of Section 17-24-40 constituted error, we must examine this statute as well as Section 44-23-610 and Section 44-17-510 through XX-XX-XXX (1976). In 1976, the date of the offense, Section 44-23-610 provided for admission or commitment proceedings for a person acquitted on the ground of insanity. This section applied to appellant during his trial in 1977. Section 44-23-610 provides that if a person is acquitted on the ground of insanity, but the court believes the person requires hospitalization, it shall order the prosecuting attorney to initiate judicial admission proceedings pursuant to Sections 44-17-510 through XX-XX-XXX. Section 44-23-610 further provides that if such proceedings are not initiated within fifteen days from the date of the order, the defendant shall be released.
In turn, Sections 44-17-510 through XX-XX-XXX give jurisdiction for judicial commitment proceedings to the probate court rather than the trial judge and the chief administrative judge. Section 44-17-520 provides for the probate court to give notice to the parties of the filing of a petition for judicial commitment and the patient's right to counsel. Section 44-17-530 provides that the probate court shall appoint counsel if counsel has not been retained, and two examiners, one a licensed physician, to examine the person. Section 44-17-530 also permits the person to request an additional examination by an independent examiner. Section 44-17-540 provides that if the two court appointed examiners agree the person is not mentally ill, the court must terminate the proceedings and dismiss the petition. However, if the two court appointed examiners are divided as to the person's condition, the court may terminate the proceedings or appoint a third examiner who must be a psychiatrist, and charge the three examiners to render a majority opinion within seven days. Sections 44-17-550, 44-17-560, *173 and 44-17-570 respectively provide for the notice of hearing and the person's right to request the names of the designated examiners and others who may testify in favor of his commitment as well as the substance of their proposed testimony, the removal of proceedings to another county, and the conduct of the hearing.
On the other hand, Section 17-24-40, which was applied in this case, gives jurisdiction to the trial judge and the chief administrative judge in the circuit where the trial was held rather than the probate court, to order that the defendant be committed to the South Carolina State Hospital for a period not to exceed 120 days. Section 17-24-40(A) states that the examination procedures to be conducted are to be governed by the standards set forth in Section 44-17-580. After the examination is conducted, a report of the findings is given to the chief administrative judge of the circuit court in which the trial was held. See, Section 17-24-40(B). Within fifteen days after receipt of the report, the chief administrative judge is to hold a hearing to decide whether the defendant should be hospitalized pursuant to the standard of Section 44-17-580. See, Section 17-24-40(C)(1). The chief administrative judge is vested with the discretion to determine whether the defendant is in need of hospitalization. See, Section 17-24-40(C)(1) and (2). "Any terms and conditions imposed by the chief administrative judge shall be therapeutic in nature, not punitive." See, Section 17-24-40(D). Further, Section 17-24-40(E) provides that at all times, the chief administrative judge of the circuit where the trial was held shall have jurisdiction over the defendant for purposes of this chapter.
Appellant asserts that he was disadvantaged by the retroactive application of Section 17-24-40 because under the law in effect at the time of appellant's offense: (1) Section 44-23-610 allowed appellant to be released if the prosecuting attorney did not initiate judicial admission proceedings within fifteen days; (2) Section 44-17-540 stated that if proceedings were initiated, they could be terminated if the two court appointed examiners were split as to appellant's mental condition; and (3) Section 44-17-530 entitled appellant to request an additional examination by an independent designated examiner. Appellant argues that he does not have these alternatives available to him under the 1984 enactment of Section 17-24-40 *174 which gives initial jurisdiction to the trial judge and then exclusive jurisdiction to the chief administrative judge.
We have reviewed appellant's arguments and find them to be without merit. First, the application of Section 17-24-40 to appellant does not constitute an ex post facto law in this instance as it does not fall within any of the four prongs of the Calder test. While the application of Section 17-24-40 may disadvantage appellant in some respects, it does not constitute an unconstitutional ex post facto law because it does not: (1) make criminal a previously innocent act; (2) aggravate a crime previously committed; (3) provide greater punishment; or (4) change the proof necessary to convict. Secondly, Section 17-24-40 is neither penal in purpose nor nature as it is not designed as a punishment or punishment enhancer. The language of Section 17-24-40 states in pertinent part "[a]ny terms and conditions imposed by the chief administrative judge shall be therapeutic in nature, not punitive." (emphasis added). Further, while we find that Section 17-24-40 was applied retroactively in this case and may have caused appellant certain disadvantages, Section 17-24-40 merely changes the mode of procedure for commitment proceedings and does not affect any substantial right of appellant. Consequently, we find that the trial judge committed no error in committing appellant to the South Carolina State Hospital pursuant to Section 17-24-40 and the sentence of the trial judge is affirmed.
Affirmed.
GREGORY, C.J., and CHANDLER, FINNEY and TOAL, JJ., concur.
NOTES
[1]  We reversed this conviction and remanded the case for a new trial in State v. Huiett, 271 S.C. 205, 246 S.E. (2d) 862 (1978) because of an improper jury instruction in which the trial judge explained to the jury that if they found appellant not guilty by reason of insanity, applicant could be committed to the South Carolina State Hospital pursuant to S.C. Code Ann. 44-23-610 (1976) for examination and that if appellant was found not to be mentally ill, he would be "set free." We ruled that this instruction warranted reversal of appellant's conviction because it was irrelevant to the jury's determination of appellant's guilt or innocence and may have prevented the jury from returning a verdict of not guilty by reason of insanity out of a fear that they might be freeing a dangerous individual into society.
[2]  Section 44-23-610 was also the applicable law in effect at the time of appellant's trial in 1977. See, State v. Huiett, supra.
