
726 So.2d 735 (1997)
Michael Lamar POWELL
v.
STATE.
CR-96-1170.
Court of Criminal Appeals of Alabama.
September 5, 1997.
Michael Lamar Powell, appellant pro se.
Ellen Leonard, asst. general counsel, Department of Corrections, for appellee.
*736 LONG, Presiding Judge.
The appellant, Michael Lamar Powell, an inmate in the Alabama prison system, appeals from the Limestone Circuit Court's denial of his petition for a writ of habeas corpus.
In his petition, the appellant contends that he is entitled to be released from prison because, he says, his sentence has expired. The relevant portion of the record reflects that in 1987, the appellant was convicted in the Mobile Circuit Court for unlawfully breaking and entering a motor vehicle and was sentenced to 15 years in prison; that sentence was split and he was ordered to serve 3 years in confinement and then the balance on probation. The appellant was subsequently released from prison and placed on probation. While on probation, he committed several new offenses. In 1991, pursuant to a plea agreement relating to these new offenses, the appellant pleaded guilty and was convicted in the Mobile Circuit Court of two counts of third-degree burglary, two counts of the unlawful possession of a controlled substance, and one count of illegal use of a credit card. In accordance with the plea agreement, the appellant was sentenced on December 3, 1991, to 30 years' imprisonment for each of the five cases, the five sentences to be served concurrently with each other and with the remainder of the appellant's sentence for his 1987 conviction, which the appellant became obligated to serve after his probation was revoked. On April 15, 1996, pursuant to an agreement reached after the appellant filed a Rule 32, Ala.R.Crim.P., petition, the Mobile Circuit Court issued an order stating that the appellant had completed his sentence for the 1987 conviction.
The appellant maintains that he is being unlawfully incarcerated because, he says, his five 1991 sentences, which were to run concurrently with his 1987 sentence, "expired" in April 1996, when the Mobile court issued the order stating that he had completed his sentence for the 1987 conviction. This claim is without merit.
Section 14-9-41(g)(2), Ala.Code 1975, provides, in pertinent part:
"When a prisoner is serving two or more sentences which run concurrently, the sentence which results in the longer period of incarceration yet remaining shall be considered the term to which such prisoner is sentenced for the purpose of computing his release date and correctional incentive time under the provisions of this article."
Under § 14-9-41(g)(2), the date of the commencement of the five sentences of 30 years' imprisonment, i.e., December 3, 1991, is the starting point for computing the appellant's remaining sentence. Because the 30-year sentences were ordered to run concurrently with the 15-year sentence imposed in 1987 and because the expiration date of the 30 year sentences was beyond the expiration date of the 1987 sentence, the sentences imposed on December 3, 1991, effectively mooted the 1987 sentence. This would have been so even if the Mobile Circuit Court had not issued the April 1996 order stating that the appellant's sentence for the 1987 conviction had been satisfied. Morrison v. State, 687 So.2d 1259 (Ala.Cr.App.1996) (prisoner received a 15-year sentence in 1986 and a concurrent 10-year sentence in 1993; because the expiration date of the 1993 sentence was beyond the expiration date of the 1986 sentence, the sentence imposed in 1993 caused the 1986 sentence to cease to exist). See Henley v. Johnson, 885 F.2d 790, 793-94 (11th Cir.1989). Thus, the appellant's sentences imposed in 1991 have not expired, and he is not entitled to be released from prison. The Limestone Circuit Court correctly denied the appellant relief on this claim.
The appellant also contends that the Limestone Circuit Court erred in denying him relief on his claim that prison officials have mistreated him and have interfered with his right of access to the courts by intentionally impeding his access to a law library, by opening his clearly marked legal related mail outside his presence, by returning to the publisher books and publications he had ordered, by punishing him for ordering such books and publications, and by confiscating and withholding his personal mailing materials used to pursue his legal claims.
*737 The relief the appellant seeks from the alleged mistreatment and the obstruction of his access to the court system is not cognizable under a writ of habeas corpus; the appropriate remedy in this case for his complaints, if proved, would not be release from custody. Taylor v. State, 455 So.2d 270 (Ala.Cr.App.1984); Phillips v. State, 41 Ala. App. 393, 133 So.2d 512 (1961); Cook v. Hanberry, 596 F.2d 658 (5th Cir.1979), revising 592 F.2d 248 (5th Cir.1979), cert. denied, 442 U.S. 932, 99 S.Ct. 2866, 61 L.Ed.2d 301 (1979). Habeas corpus relief is not available to prisoners complaining only of mistreatment during a legal incarceration. Cook, supra; Granville v. Hunt, 411 F.2d 9, 12-13 (5th Cir.1969); Williams v. Steele, 194 F.2d 917 (8th Cir.1952), cert. denied, 344 U.S. 822, 73 S.Ct. 20, 97 L.Ed. 640 (1952). The sole function of habeas corpus relief is to provide relief from unlawful imprisonment or custody, and it cannot be used for any other purpose. See Rheuark v. Shaw, 547 F.2d 1257, 1259 (5th Cir.1977). While the appellant's allegation that prison officials have mistreated him and barred his access to the court system may be subject to judicial review in a court of proper jurisdiction, his complaint in this case does not relate to the legality of his confinement or to the legal sufficiency of the criminal proceedings that resulted in his incarceration. There is nothing for this court to review with regard to this issue.
Finally, the appellant contends that under the 1991 plea agreement, he pleaded guilty to and was convicted of two counts of third degree burglary, but that the Department of Corrections' inmate summary sheet erroneously reflects that one of those burglary convictions was for second-degree burglary. Furthermore, the appellant contends that the inmate summary sheet erroneously reflects that the sentence for the second-degree burglary conviction was to be served consecutively, rather than concurrently, with the sentences he received for his other 1991 convictions. The state does not specifically refute these claims. The appellant maintains that as a result of these errors, the Department of Corrections has miscalculated his date of eligibility for parole consideration. As the appellant alleges, his inmate summary sheet indeed reflects convictions in 1991 for second-degree burglary and third-degree burglary and also reflects that the sentence for his second degree burglary conviction was to be served consecutively with the sentences for his other 1991 convictions. The record contains a transcript of the guilty plea proceedings that took place in 1991. The transcript of the guilty plea proceedings clearly reflects that although the appellant was originally charged with one count of second-degree burglary and one count of third-degree burglary, the appellant pleaded guilty to and was convicted of two counts of third-degree burglary; the transcript further reflects that the appellant's sentences for both of these convictions were to be served concurrently with each other and with the sentences for his other 1991 convictions. See Ex parte Powell, 641 So.2d 772, 774 (Ala.1994) (detailing the convictions and sentences at issue in this appeal). In order to avoid any confusion over the length of the appellant's sentence, in terms of his earliest possible parole release date, we remand this case to the Limestone Circuit Court with instructions that the court order the Department of Corrections to correct its records to accurately reflect the appellant's conviction for third-degree burglary, rather than second degree burglary, in case no. CC-91-2383 and to reflect that the appellant's 30-year sentence for that third-degree burglary conviction was to be served concurrently, rather than consecutively, with the other sentences the appellant received in 1991. Furthermore, the Limestone Circuit Court is ordered to hold an evidentiary hearing to determine whether these changes would affect the appellant's parole review date. A return should be filed with this court within 42 days after the release of this opinion.
REMANDED WITH INSTRUCTIONS.[*]
ALL THE JUDGES CONCUR.
NOTES
[*]  Note from the reporter of decisions: On August 14, 1998, on return to remand, the Court of Criminal Appeals affirmed, without opinion. On October 2, 1998, that Court denied rehearing, without opinion. On December 18, 1998, the Supreme Court denied certiorari review, without opinion (1980153).
