
540 So.2d 81 (1989)
Donald McSWAIN
v.
Larry STRICKLIN, Director Taylor Hardin Secure Medical Facility, et al.
Civ. 6730.
Court of Civil Appeals of Alabama.
February 1, 1989.
*82 Ginger E. Garrett, Tuscaloosa, for petitioner.
E.J. "Mac" McArthur, Montgomery, for respondents.
EDWARD N. SCRUGGS, Retired Circuit Judge.
Mr. McSwain was the pro se petitioner for a writ of habeas corpus against Mr. Stricklin, the Director of Taylor Hardin Secure Medical Facility (Taylor Hardin) and the Alabama Department of Mental Health and Mental Rehabilitation (department). He avers that he is a patient at Taylor Hardin, that he is now of sound mind and understanding since he has been in a stable condition for over a year upon the medication that he is taking, that he was not probate committed but that he was charged with a felony in 1986 and was found not guilty by reason of insanity by the Circuit Court of Mobile County and that all of the criminal charges against him have been dropped. He then avers that he was transferred from Taylor Hardin to Searcy Hospital in December 1987 where he had full ground privileges and he complains of being transferred back to Taylor Hardin where he is not given the opportunity to work as he did at Searcy Hospital for one hour a day. He sought his release to his sister in Mobile. An attorney was appointed to represent the petitioner. The defendants answered the petition. After an ore tenus trial before the Circuit Court of Tuscaloosa County, the following judgment was entered:

"ORDER
"This cause was heard on the Petition for Habeas Corpus. The Court considered the pleadings, testimony, affidavits and correspondence in the official file. The Court finds that:
"1. The Petitioner, Donald McSwain, is being lawfully held at the Taylor Hardin Secure Medical Facility, Department of Mental Health and Mental Retardation pursuant to an Order rendered by Braxton L. Kittrell, Circuit Judge, Mobile County, Alabama, on January 27, 1987.
"2. The Petitioner, Donald McSwain, is at Taylor Hardin Secure Medical Facility for treatment as a result of his being found not guilty by reason of insanity on the charge of sexual abuse in the first degree in said Circuit Court of Mobile County, Alabama.
"3. The Petitioner continues to be severally [sic] mentally ill and meets the requirements under the provisions of Lynch v. Baxley, CV 74-89-N, United States District Court for the Middle District of Alabama, Northern Division. The Court finds that:
"a. that the patient is mentally ill.
"b. that the patient poses a real and present threat of substantial harm to himself or others.
"c. that such danger has been evidenced by a recent act of the patient, or that such an overt act would have been committed in the absence of certain treatment and medication presently administered to the patient.
"d. that there is treatment available for the patient and that his confinement is necessary for his and the community's safety and well being.
"e. that continued commitment is the least restrictive alternative necessary and available for the treatment of the patient's mental illness.
"The Petition for Habeas Corpus is denied."
The ground of the petitioner's motion for a new trial was that he no longer meets the requirements of Lynch v. Baxley, 386 F.Supp. 378 (M.D.Ala.1974), because his commitment in Taylor Hardin is not the least restrictive alternative necessary and available for the treatment of his mental illness and that, as a consequence thereof, the petitioner is unduly restricted in contradiction of his treatment needs and his constitutional right to treatment in the least restrictive environment. That new trial motion was overruled by the trial court and the petitioner timely appealed. He does not contend on this appeal that he should *83 be released at this time from the custody of the department's commissioner. That was a correct and proper determination on the petitioner's behalf because credible evidence supported the findings and judgment of the trial court in that regard. Nix v. State, 481 So.2d 403 (Ala.Civ.App.1985).
The petitioner first contends that, under the provisions of section 22-52-33, Code 1975, when a person who is in the custody of the department has been adjudicated to be not guilty by reason of insanity "pursuant to the provisions of sections 15-16-24, 15-16-25 and 15-16-40," the commissioner, or his designee, shall petition the specified judge of probate for an order of civil commitment of that person to the department. § 22-52-33, Code 1975. Apparently, no such order appears in the petitioner's file at Taylor Hardin.
Two of those code sections, § 15-16-25 and § 15-16-40, were repealed by Acts 1981, No. 81-708, p. 1189, § 5. The other code section mentioned in § 22-52-33 is § 15-16-24, which pertains only to possible jury verdicts in cases where there is a plea of not guilty by reason of insanity. Here, that code section had no application because there was no jury trial. The adjudication as to the petitioner's being not guilty by reason of insanity was made by the trial court after the district attorney confessed the petitioner's special plea of not guilty by reason of insanity.
Because of the above, the petitioner was not adjudged to be not guilty by reason of insanity pursuant to the three code sections, or any of them, which were designated in section 22-52-33. Indeed, compliance with section 22-52-33 is no longer possible nor required because of the repeal of two of the three code sections mentioned therein.
No error exists as to the first issue.
The petitioner's last contention that was argued by his learned counsel is that the trial court erred in finding that the petitioner was not unduly restricted in contradiction of his treatment needs and his constitutional right to treatment in the least restrictive environment. In short, it is contended that he could function and receive treatment in a less restrictive environment than is provided at Taylor Hardin.
While this was primarily a habeas corpus proceeding, that issue was tried without objection. Alabama Rules of Civil Procedure, Rules 15(b) and 54(c).
Ore tenus evidence was heard by the trial court. Therefore, we must presume that the trial court correctly ruled and we are not authorized to disturb it unless it was so unsupported by the evidence as to be palpably wrong. Winchester v. Bartlett, 532 So.2d 1258 (Ala.Civ.App.1988); Nix, 481 So.2d at 404. If there was credible evidence to support the trial court's ruling, we cannot say that it was palpably wrong. Winchester, 532 So.2d at 1260.
We have carefully read all of the testimony in this case.
The petitioner was a patient of Dr. Bryant, a staff psychiatrist at Taylor Hardin. The following is a summary of some of the pertinent portions of Dr. Bryant's ore tenus evidence which he gave as a witness on behalf of the petitioner and which tends to support the decision of the trial court upon this issue.
In December 1987 the patient was transferred from Taylor Hardin to Searcy Hospital, a somewhat less restrictive facility, but he (along with all other insanity acquittees) was returned to Taylor Hardin in March 1988, not because of any wrongdoing on the patient's behalf, but for the reason that it was felt that Taylor Hardin would do a better job than could be done at Searcy Hospital in treating him and in obtaining his ultimate return to society. At Taylor Hardin they had revamped and were in the process of implementing their own programs to accomplish the objective of the ultimate release of insanity acquittees. That objective was not being accomplished at Searcy Hospital. During the week following the trial, the petitioner was to be considered for possible work at Bryce Hospital under the new program.
The petitioner is diagnosed as being a schizophrenia chronic undifferentiated type with alcohol and drug abuse problems. His schizophrenia is in partial remission at this *84 time because he takes medication daily and is receiving individual and group therapy at Taylor Hardin. The petitioner is gradually showing improvement but he could not function in an environment which is less restrictive than at Taylor Hardin. The doctor observed no change in the type of behavior that rendered the patient to be in his present legal difficulty. It was the doctor's opinion that, if the patient is released at this time, he would not take his medication and, without his medication, any remission of his mental disease would "go away" and he would be right back where he was when he was first admitted to Taylor Hardin in February 1987.
The doctor further testified that, if the petitioner is released into society in his present condition without any structure, he would be dangerous because he would revert back to his previous behavior concerning alcohol, drugs, and questionable sexual abuse. His mental illness makes the petitioner a danger to himself or to others. There is treatment available for him and he is receiving it at Taylor Hardin, which is the least restrictive alternative which is available for his treatment.
We pretermit a summary of any other evidence since it is obvious to us that the above testimony of Dr. Bryant was credible evidence that fully supported the trial court's decision on the issue concerning treatment in a less restrictive environment.
We affirm.
The foregoing opinion was prepared by Retired Circuit Judge EDWARD N. SCRUGGS while serving on active duty status as a judge of this court under the provisions of section 12-18-10(e), Code 1975, and this opinion is hereby adopted as that of the court.
AFFIRMED.
All the Judges concur.
