
238 S.E.2d 229 (1977)
Paul D. TASKER
v.
Harry GRIFFITH, acting warden, etc., et al.
No. 13943.
Supreme Court of Appeals of West Virginia.
November 1, 1977.
*230 John R. Hoblitzell, Kay, Casto & Chaney, Charleston, for relator.
Chauncey H. Browning, Jr., Atty. Gen., Richard L. Gottlieb, Asst. Atty. Gen., Charleston, for respondents.
NEELY, Justice:
Paul D. Tasker is a prisoner at the Huttonsville Correctional Center, serving a one to ten year sentence for breaking and entering. In this habeas corpus action Mr. Tasker does not challenge the validity of his sentence or conviction, but rather the conditions of his confinement at Huttonsville. He contends that during his imprisonment at Huttonsville prison officials twice placed him in administrative segregation in violation *231 of his due process and equal protection rights and his right to be free from cruel and unusual punishment. We award the writ of habeas corpus as molded.
Evidence before the Court demonstrates that the Huttonsville Correctional Center maintains a special cellblock for use in cases of administrative segregation, protective custody, and disciplinary detention. During his administrative segregation Mr. Tasker was confined in this cellblock which is located in an interior room at the prison. The cellblock contains six cells, each of which is equipped with a bed, mattress, commode, wash basin, and drinking fountain. The food provided to prisoners confined in the cellblock for administrative purposes is the same as the general prison population receives, and those prisoners confined for extended periods are regularly taken out for showers and exercise. The rules at Huttonsville indicate that the mail privileges of an inmate in administrative segregation are not curtailed and that access to legal materials is provided. Nothing in the record suggests these rules are not observed.
The first administrative segregation of Mr. Tasker began at 3:15 p.m. on January 15, 1977. The prison authorities were investigating Mr. Tasker's alleged involvement in certain acts of violence which occurred at the prison, and the evidence indicates they thought they could better investigate the matter if Mr. Tasker were isolated from the other inmates. When he was placed in administrative segregation, Mr. Tasker was notified simply that he was under investigation. He was released from administrative segregation on January 19, 1977, at which time he was notified that the investigation had cleared him of all suspicion in the matter. Mr. Tasker was again isolated from the general inmate population at 11:30 a.m. on May 11, 1977. On this occasion he was notified that he was under investigation for receiving a contraband substance through the mail. The evidence here, however, does not indicate any logical reason why Mr. Tasker should have been isolated during that investigation. Mr. Tasker was released from this administrative segregation on May 14, 1977, after the investigation had exonerated him.

I
At the outset we must confront certain procedural difficulties which should be evident from the above recitation of facts. There is a serious question whether a habeas corpus action is the proper method for petitioner to test the constitutionality of his segregated confinement, when he does not challenge the validity of his conviction, when he prays for reformation of institutional rules, and when he does not seek release from custody. The leading federal case in this area, Wolff v. McDonnell, 418 U.S. 539, 94 S.Ct. 2963, 41 L.Ed.2d 935 (1974), which petitioner cites frequently in his brief, was not a habeas corpus action, but rather a complaint filed under 42 U.S.C. § 1983 seeking damages and injunctive relief.
Habeas corpus lies to test the legality of the restraint under which a person is detained. In this case it is necessary to distinguish between two types of restraint. The first, which petitioner does not challenge, is the restraint imposed on the petitioner because of his conviction in court of breaking and entering. The second is the restraint of the petitioner in administrative segregation because of his alleged infraction of prison rules and regulations. We hold that the scope of the writ of habeas corpus extends to cover the second instance of restraint, which has its basis conduct not related to the original conviction and which involves significant added restrictions upon a prisoner's very limited personal liberty. We find support for our position in the parallel interpretation of the scope of federal habeas corpus proceedings by a distinguished panel of fourth circuit judges, composed of Chief Judge Haynsworth and Circuit Judges Winter and Craven, in McNair v. McCune, 527 F.2d 874 (4th Cir. 1975) where they held that:
[T]here is federal habeas corpus jurisdiction over the complaint of a federal prisoner who is challenging not the validity of his original conviction but the imposition of segregated confinement without *232 elementary procedural due process and without just cause. [527 F.2d at 875.]
A second procedural dilemma stems from the fact that the petitioner no longer is confined in administrative segregation. We cannot, therefore, dispose of this matter by ordering his release from administrative detention. Nor would our declaration that petitioner's confinement was invalid give the petitioner effective relief. The record before us indicates that no collateral consequences are attached to petitioner's administrative segregation so the petitioner suffers no present harm from his past confinement. We are thus in a position where we cannot lift the burden of present disabilities from the petitioner's shoulders in the event we find his substantive claims have merit. This circumstance, however, does not deprive us of jurisdiction to hear the case and resolve the important procedural due process questions involved. It is obvious that prison authorities could frustrate any meaningful habeas corpus challenge to their procedures by releasing prisoners from allegedly illegal restraints before the prisoners' cases mature for hearing on our docket or the circuit court dockets. To guard against such a possibility we must be prepared in appropriate habeas corpus cases to grant what amounts to prospective declaratory relief. The case of State ex rel. Hawks v. Lazaro, W.Va., 202, S.E.2d 109 (1974) is ample authority for our position. The pertinent language from that habeas corpus case is:
Although the State has attempted to correct many of the obvious procedural errors in the May 1969 hearing, the Court is of the opinion that this case, taken in its entirety, presents a justiciable controversy of substantial public importance. The respondent [Director of Clinical Services, Huntington State Hospital] cannot deprive citizens of court review of a widespread violation of constitutional rights by curing procedural irregularities in individual cases after they have been brought to the court's attention. [202 S.E.2d at 115.]
If court review of constitutional violations cannot be frustrated by curing procedural irregularities post hoc, then, likewise, review cannot be frustrated by releasing an illegally confined person before his habeas corpus petition can be processed, particularly when the person continues to be in jeopardy of further illegal confinement of the same character. Not every case will fit this pattern, but in our view the peculiar facts of the case before us justify the exercise of our habeas corpus jurisdiction.

II
We turn now to a discussion of the merits of the case. Before examining in detail the due process requirements set down in the leading case, Wolff v. McDonnell, 418 U.S. 539, 94 S.Ct. 2963, 41 L.Ed.2d 935 (1974), we need to examine generally how due process operates in a prison context. It is obvious that prisoners relinquish certain rights when entering prison. As the Wolff majority puts it, "Lawful imprisonment necessarily makes unavailable many rights and privileges of the ordinary citizen, a `retraction justified by the considerations underlying our penal system.' [citation omitted]" 418 U.S. at 555, 94 S.Ct. at 2974. On the other hand, "a prisoner is not wholly stripped of constitutional protections when he is imprisoned for crime." 418 U.S. at 555, 94 S.Ct. at 2974. Here then, as in so many areas, the judiciary is called on to make sense out of apparently conflicting constitutional demands by striking an appropriate balance. Specifically, we must achieve in the prison context a "mutual accommodation between institutional needs and objectives and the provisions of the Constitution that are of general application." 418 U.S. at 556, 94 S.Ct. at 2975.
Disciplinary procedures are of primary importance in prisons where order must be maintained in an environment which constantly threatens to degenerate into chaos. No sensitive observer or prison life would be likely to question the prison authorities' need for some effective means to maintain order. The problems confronting prison authorities are many and varied, as the following perceptive analysis from Wolff demonstrates:

*233 [Prison is] a closed, tightly controlled environment peopled by those who have chosen to violate the criminal law and who have been lawfully incarcerated for doing so. Some are first offenders, but many are recidivists who have repeatedly employed illegal and often very violent means to attain their ends. They may have little regard for the safety of others or their property or for the rules designed to provide an orderly and reasonably safe prison life. Although there are very many varieties of prisons with different degrees of security, we must realize that in many of them the inmates are closely supervised and their activities controlled around the clock. Guards and inmates co-exist in direct and intimate contact. Tension between them is unremitting. Frustration, resentment, and despair are commonplace. Relationships among the inmates are varied and complex and perhaps subject to the unwritten code that exhorts inmates not to inform on a fellow prisoner.
It is against this background that disciplinary proceedings must be structured by prison authorities; and it is against this background that we must make our constitutional judgments, realizing that we are dealing with the maximum security institution as well as those where security considerations are not paramount. The reality is that disciplinary hearings and the imposition of disagreeable sanctions necessarily involve confrontations between inmates and authority and between inmates who are being disciplined and those who would charge or furnish evidence against them. Retaliation is much more than a theoretical possibility; and the basic and unavoidable task of providing reasonable personal safety for guards and inmates may be at stake, to say nothing of the impact of disciplinary confrontations and the resulting escalation of personal antagonisms on the important aims of the correctional process. [418 U.S. at 561-562, 94 S.Ct. at 2977.]
What, then, are the constitutional protections that can appropriately be extended to prisoners being disciplined in such a setting? Wolff, again gives a clear answer. There must be "advance written notice of the claimed violation and a written statement of the factfinders as to the evidence relied upon and the reasons for the disciplinary action taken." 418 U.S. at 563, 94 S.Ct. at 2978. Furthermore, "a brief period of time after the notice, no less than 24 hours, should be allowed to the inmate to prepare [his case]," 418 U.S. at 564, 94 S.Ct. at 2979, and an "inmate facing disciplinary proceedings should be allowed to call witnesses and present documentary evidence in his defense when permitting him to do so will not be unduly hazardous to institutional safety or correctional goals." 418 U.S. at 566, 94 S.Ct. at 2979. Finally, some lay assistance should be made available to the inmate where he is illiterate or "where the complexity of the issue makes it unlikely that the inmate will be able to collect and present the evidence necessary for an adequate comprehension of the case . . ." 418 U.S. at 570, 94 S.Ct. at 2982.
It is clear from the record that inmates at Huttonsville Correctional Center charged with disciplinary infractions are afforded these minimum required procedural safeguards and more. For example, at Huttonsville the inmate himself, not the prison officials, designates a representative to assist him at the disciplinary hearing, and the inmate may confront and cross-examine any prison employee witness against him, a right the U. S. Supreme Court pointedly refused to extend in Wolff.
Having determined that Huttonsville's disciplinary proceedings are properly conducted, we must examine the procedures which prison officials observe in confining an inmate to administrative segregation before the time disciplinary proceedings are formally initiated.[1] Basically, the inmate is informed that he will be confined pending investigation into his alleged misconduct. *234 It is not clear whether the inmate is regularly advised of the nature of the offense being investigated. In the case before us the relator was twice segregated, and only once did he receive notice at the time he was segregated of the offense under investigation. When the investigation is concluded, the inmate is notified of its results. Here on both occasions, for example, the prison officials told relator that he had been exonerated. Had they determined to press formal charges against him, the prison officials, we assume, would have given the relator the advance written notice of the charges which their rules require.
We understand the need, recognized by the Supreme Court in Wolff, to protect inmates, staff, and property from anti-social conduct. In the case before us there is a distinction between segregation for investigation into petitioner's possible association with a violent gang of inmate extortioners, and segregation for investigation into receipt of illegal drugs through the mail. Administrative segregation should not be used as a punishment, nor should it be used when the safety of the institution or integrity of the investigation is not at stake. Furthermore, reading privileges, smoking, and other general comforts should be available to the prisoner administratively segregated to the extent they would have been available had he not been segregated. This, of course, does not apply to disciplinary segregation after a procedurally sufficient hearing.
We hold that before placing an inmate in administrative segregation, the prison authorities must advise him that he is under investigation for misconduct. The inmate should be advised of the specific offense under investigation, unless the prison authorities in their discretion determine that such disclosure could adversely affect the integrity of the investigation. When the investigation is concluded, the authorities must advise the inmate whether he was exonerated or whether formal disciplinary proceedings will be instituted. At this point the inmate should receive an explanation of the charges against him, if such an explanation has not already been provided. Finally, the prison officials must have specific reasons for determining that effective investigation of the charges requires the isolation of the inmate involved. If no specific reason for isolation can be articulated, administrative segregation is inappropriate and should not be imposed. We are speaking now of solitary confinement, or at least close confinement; if administrative segregation is accomplished under less restrictive circumstances, it may be used for other reasonable purposes. We are concerned here only with something which looks and feels like punishment but which is denominated "administrative segregation."
These safeguards are by no means as extensive as those that must be observed in formal disciplinary proceedings, but we feel they provide appropriate protection for inmates facing administrative segregation for investigation of misconduct. One further limitation must be imposed on prison authorities, however, to insure that the easier-accomplished administrative segregation does not become a substitute for disciplinary isolation. That is, ordinarily no inmate can be confined in administrative segregation more than one time for an investigation into each charge of misconduct, and the confinement cannot exceed three days. This three-day limit will keep prison authorities from inflicting punitive segregation on inmates under the guise of open-ended administrative investigation into misconduct, and the requirement that prison authorities disclose to inmates the nature of the charges under investigation will protect inmates against repeatedly being segregated for investigation of the same offense. We recognize that the three-day limit is an arbitrarily drawn line, but it seems to us that a prisoner's loss is not so grievous as to require full procedural safeguards when his confinement is administrative segregation extends no more than three days. This line is drawn in reference to the conditions of administrative segregation disclosed in the record before us, i. e., solitary or close confinement in an isolated cellblock. Should those conditions become more severe, it *235 might be necessary to reconsider the three-day limit. We also note that the three-day limit appears to serve the legitimate needs of the prison authorities, since their own rules provide that "an inmate may be held for a maximum of three (3) days without a charge, pending investigation." Rules and Regulations Governing Inmates of the Huttonsville Correctional Center, IX (F)(1).
While the majority of the relator's allegations concern the inadequacy of the procedural safeguards extended to him in this case, he also raised questions concerning discriminatory treatment and cruel and unusual punishment. We have reviewed the applicable legal authorities and the pertinent portions of the record, and we conclude that these questions are without merit. Our relief in this matter is limited to a declaration that petitioner was justifiably aggrieved by his administrative segregation during the investigation of his alleged receipt of contraband, and to our setting forth guidelines to protect petitioner in the future. Accordingly, for the foregoing reasons, the writ of habeas corpus as molded is awarded.
Writ awarded.
NOTES
[1]  We limit our review of administrative segregation procedures to those instances where an inmate is confined during an investigation of his misconduct, since this appeal does not involve other types of administrative segregation, such as protective custody.
