OPINION OF THE COURT
GARTH, Circuit Judge.
I.
This case raises serious and complex questions of the constitutionality of conditions under which pre-trial detainees and sentenced inmates are confined at the Union County Jail (the Jail). All parties agree that the Jail is seriously overcrowded and dispute exists only as to whether that overcrowding and the conditions that result from it are so shocking that confinement in the Jail amounts to punishment of the pretrial detainees in violation of the due process clause or to cruel and unusual punishment of the sentenced inmates in violation of the Eighth Amendment. The district court held that the conditions are unconstitutional for both classes of inmates and that the unconstitutionality could only be remedied if the Commissioner of the Department of Corrections of the State of New Jersey removed those inmates sentenced to state prison. We cannot agree.
II.
On March 25, 1981, inmates of the Union County Jail (hereinafter inmates) filed this civil rights action under 42 U.S.C. § 1983, alleging that the Jail was over-populated1 and that the “totality of conditions” at the Jail violated the inmates’ constitutional right to due process and equal protection of the laws and their right to be free from cruel and unusual punishment. The complaint sought a declaration that the conditions at the Jail were unconstitutional and an injunction ordering the County to reduce the population to constitutional levels. The complaint was brought as a class action, the class consisting of all persons who were then, or who during the pendency of the suit would become, incarcerated in the Jail. The class, certified by the district court, included pre-trial detainees2 (inmates awaiting trial and not considered bailworthy) and inmates sentenced to terms either in the Jail or in state prison. The com[987]*987plaint named as defendants various judges,3 administrators of the jail, and county officials (hereinafter known collectively as the County).
On April 3, 1981, the County filed an answer to the complaint, admitting that the inmates were held in the overcrowded conditions specified in the complaint. In a third-party complaint filed on the same day against the Commissioner of the New Jersey State Department of Corrections (the Commissioner), the County attributed any unconstitutionality of conditions at the Jail to overcrowding resulting from the refusal of the Commissioner to accept for custody those prisoners who had been sentenced to state prison. The County argued that, pursuant to NJ.Stat.Ann. 2C:43-10(e) (West 1982), the Commissioner was required to remove from county facilities, within 15 days after sentencing, those inmates sentenced to terms in state correctional facilities (state prisoners). The County sought a declaration that the Commissioner’s refusal to accept state prisoners was unconstitutional and sought an injunction permanently preventing him from refusing to take custody of state prisoners.
On June 19,1981, responding to the statewide prison overcrowding problem, Governor Byrne issued Executive Order No. 106,4 in which he declared that overcrowded conditions in New Jersey’s State Prisons and county facilities constituted a state of emergency, and that flexibility was needed in the assignment of inmates in order to maximize the use of space. The Order suspended the operation of NJ.Stat.Ann. 2C:43-10(e) (West 1982), and empowered the Commissioner of Corrections to designate the [988]*988place of confinement for both state and county inmates, whether pretrial detainees or sentenced inmates. The Commissioner, exercising the discretion conferred by the Executive Order, designated the Jail as the place of confinement for state prisoners sentenced in Union County. The Commissioner determined that the Jail, with modifications of the existing structure, could accommodate a number of inmates greater than its rated capacity.
On October 22, 1981 the district court approved a consent agreement between the County and the inmates. The Commissioner was not a party to the agreement. This agreement specified a maximum population capacity of 288 for the Jail (assuming there would be one person in each general population cell) and designated a procedure whereby the County could request an immediate hearing before the district court in the event the population of the Jail approached or reached the maximum capacity specified. The agreement contemplated that the district court might, under such circumstances, order the release or transfer of enough inmates to reduce the population below the stated maximum. On that same date, the court entered an order directing the Commissioner to show cause why he should not be compelled to accept custody of all state prisoners in the Jail.
On November 10,1981, the Commissioner filed a motion to vacate and set aside the consent judgment under Fed.R.Civ.Proc. 60(b)(1) and 60(b)(6), on the grounds that it was entered without the consent of the Commissioner, and that the consent given by the County was illegal as ultra vires under state law. The Commissioner contended that the County was without the authority to enter such an agreement, under the terms of Governor Byrne’s Executive Orders Nos. 106 and 108.
On December 16, 1981, the district court stayed scheduled hearings on the County’s order to show cause and the Commissioner’s motion to vacate the consent judgment, pending the decision of the New Jersey Supreme Court in Worthington v. Fauver, 88 N.J. 183, 440 A.2d 1128 (1982). On January 6, 1982, the Supreme Court of New Jersey in that case unanimously held that Executive Orders Nos. 106 and 108 (Byrne) were a valid exercise of the power delegated to the Governor under the Civil Defense and Disaster Control Act, N.J.Stat.Ann. App. A:9-30 et seq. (West 1982), that the Orders did not violate the state constitutional doctrine of separation of powers, and that the Commissioner’s actions pursuant to the orders were not arbitrary or capricious.
On December 21, 1981 the inmates made a motion to hold the County in contempt for failure to abide by the consent decree. On January 8, 1982 the County made a motion to vacate the consent judgment. The district court held a hearing on January 20, 1982 in order to consider the two motions previously stayed (the County’s motion for a preliminary injunction against the Commissioner, and the Commissioner’s motion to vacate the consent judgment) as well as the two new motions. The district court reasoned that if the County could comply with the consent judgment, then the necessary actions would be within the scope of the County’s authorized responsibility and the Commissioner would lack standing to attack the consent order.
On January 29, 1982, the district court, pursuant to Fed.R.Civ.P. 53(b), appointed a Special Master to investigate conditions at the Jail and to assess the County’s efforts under the consent judgment. Pending return of the Special Master’s Report within 45 days, the district court denied without prejudice the Commissioner’s motion to vacate the consent order and deferred ruling on the other motions.
The Special Master filed his Report and Recommendations on March 1, 1982. Most notably, the Special Master found that, because of overcrowding, general population cells designed for one inmate were being used to house two inmates by use of mattresses placed on the floors of these 5' X 7' cells next to the toilet. The better part of the men’s exercise area and all of the women’s recreation area had also been converted into temporary dormitories, in which inmates slept on mattresses placed on the floor. Altogether, with respect to the pretrial detainees, the Special Master found six [989]*989specific conditions that he regarded as constitutional violations. See note 11, infra.5
With respect to the sentenced inmates, the Special Master found two conditions that he regarded as constitutional violations. The Special Master recommended that these specific violations should be cured, and that the Commissioner should be given a reasonable time to bring the population of the Jail down to the limit specified by the consent judgment. He also found that the County had made a good faith attempt to comply with the provision of the consent judgment requiring maintenance of essential and other inmate services, and that any failures on the County’s part were due to the overcrowding problem.
On March 12, 1982, the Commissioner filed objections to the Special Master’s Report. He argued that the Special Master should have recommended only the correction of the particular objectionable conditions, rather than the transfer of state inmates. The Commissioner noted that the practice of double-bunking inmates had not been regarded as unconstitutional per se by the Special Master.6 The Commissioner argued that the County need only equip its general population cells with two bunk-type beds in order both to eliminate the unconstitutional practice of placing mattresses on the floor and to increase the recreational opportunities for both male and female inmates. He argued further that clean clothes could be provided to inmates at least once each week and a medical screening procedure instituted, insofar as the County already had an inmate-operated laundry on the premises and a doctor and medical staff at the Jail every day. On March 25, 1982, the court held a hearing on the Commissioner’s objections to the Special Master’s Report.
On April 27,1982, the court filed an opinion and order, adopting the findings of fact of the Special Master without modification. The court held that the totality of circumstances resulting from overcrowding at the Jail, and most notably forcing pre-trial detainees to sleep on mattresses placed on the floor, constituted a violation of the detainees’ due process rights. The court rejected the Commissioner’s contention that installation of double-bunks and other improvements could remedy these unconstitutional conditions. The court held that, based on space considerations alone, double-celling “amounted to punishment,” in violation of the detainees due process rights. The court also held that requiring the sentenced inmates to sleep for extended periods on mattresses placed on the floor constituted cruel and unusual punishment. It held, in addition, that even if bunk beds were substituted for floor mattresses, the shelter provided would fail to meet “contemporary standards of decency” and thus violate the Eighth Amendment, since the sentenced inmates would have only 30 square feet of daytime space and 19.5 square feet of sleeping space.
Having concluded that the conditions in the Jail were constitutionally impermissible, the court held that, under the Supremacy Clause, the Executive Orders that had caused the overcrowding in the Jail must yield. The court declared the Commissioner’s action of designating the Jail as the place of confinement for state prisoners void and ordered the Commissioner to remove, by July 1, 1982, all state prisoners who on that date had been confined in the Jail for fifteen days or more since being sentenced to terms of imprisonment in state facilities. The order also required full compliance with NJ.Stat.Ann. 2C:43-10(e) (West 1982) thereafter.
The court also directed the County, pursuant to its duties under the consent judgment, to implement a medical screening program, to reinstate the recreation and visitation programs at prior levels, and to comply with state regulations that require it to provide inmates with clean clothing and towels.
[990]*990The Commissioner appealed from the April 27, 1982 order. Neither the County nor the inmates have appealed.
III.
Jurisdiction
When the district court entered its April 27, 1982 order, there were three pending motions before the court. First, the motion of the County for a preliminary injunction directing the Commissioner to remove state prisoners from the Jail; second, the motion of the inmates to hold the County in contempt of the consent judgment; and third, the motion of the County to vacate the consent judgment. The motion of the Commissioner to vacate the consent judgment, denied without prejudice in the district court’s January 29, 1982 order, was apparently not renewed by the Commissioner,7 and the district court ordered that the consent judgment be continued in full force and effect.
The district court disposed of these motions by enjoining the defendants “to reduce the population of the Union County Jail to constitutional levels.” The court “declare[d] that the failure and continued refusal of the Commissioner ... to comply with the mandates of N.J.S.A. 2C:43-10(e) is unconstitutional” and “permanently enjoined the Commissioner ... from refusing to accept State prisoners from the Union County Jail in conformity with N.J.S.A. 2C:43-10(e).” See Union County, 537 F.Supp. at 1009, 1015. The order thus implicitly denied the motion of the inmates to hold the County in contempt of the consent judgment. Finally, the order “continue[d] in full force and effect, except as modified or supplemented,” the consent judgment approved on October 22,1981. Union County, 537 F.Supp. at 1015. Accordingly, the order, disposing of all claims by all parties, and leaving “nothing to be done but to enforce ... what has been determined,” is “final” for purposes of 28 U.S.C. § 1291. Richerson v. Jones, 551 F.2d 918 at 922 (3d Cir.1977). It is from this order that the Commissioner appeals.8
The County did not appeal from the April 27, 1982 order continuing the consent judgment in full force and effect.
i
[991]*991IV.
Pre-trial Detainees
A.
The constitutional framework and the more particular standard governing the due process rights of pre-trial detainees were articulated by the Supreme Court in Bell v. Wolfish, 441 U.S. 520, 99 S.Ct. 1861, 60 L.Ed.2d 447 (1979). In Bell the Court held that
[i]n evaluating the constitutionality of conditions or restrictions of pretrial detention that implicate only the protection against deprivation of liberty without due process of law, we think that the proper inquiry is whether those conditions amount to punishment of the detainee.
Bell v. Wolfish, supra, 441 U.S. at 535, 99 S.Ct. at 1871 (emphasis added). Noting that the Government may detain an individual to ensure his presence at trial, id. at 536, 99 S.Ct. at 1872, and that the Government traditionally has done so by “confinement in a facility which ... results in restricting the movement of a detainee,” id. at 537, 99 S.Ct. at 1873, the Court concluded that the necessary inquiry was whether “the conditions and restrictions of the detention facility ... amount to punishment.” Id. at 536-37, 99 S.Ct. at 1872-73. In order to determine whether “particular restrictions and conditions accompanying pretrial detention amount to punishment in the constitutional sense of that word,” id. at 538, 99 S.Ct. at 1873, the Court stated that the list of factors identified in Kennedy v. Mendoza-Martinez, 372 U.S. 144, 168-69, 83 S.Ct. 554, 567-68,9 L.Ed.2d 644 (1963)9 would provide useful guideposts. Focussing particularly upon the last two of the Mendoza-Martinez factors, the Court concluded that it “must decide whether the disability is imposed for the purpose of punishment or whether it is an incident of some other legitimate governmental purpose,” and whether the disability or restraint “appears excessive in relation to the alternative purpose assigned [to it].” Bell v. Wolfish, supra, 441 U.S. at 538, 99 S.Ct. at 1874 (quoting Mendoza-Martinez, 372 U.S. at 168-69, 83 S.Ct. at 567-68, 9 L.Ed.2d 644). The Court stated that, in the event that such a condition or restriction “is not reasonably related to a legitimate goal — if it is arbitrary or purposeless — a court permissibly may infer that the purpose of the governmental action is punishment.” Bell v. Wolfish, supra, 441 U.S. at 539, 99 S.Ct. at 1874.
Developing this analysis further as it pertained to detainees, the Court stated:
[I]n addition to ensuring the detainees’ presence at trial, the effective management of the detention facility once the individual is confined is a valid objective that may justify imposition of conditions and restrictions of pretrial detention and dispel any inference that such restrictions are intended as punishment.
Bell v. Wolfish, supra, 441 U.S. at 540, 99 S.Ct. at 1875 (footnote omitted). The Court also noted that, in determining whether conditions and restrictions are reasonably related to such a purpose,
courts must heed our warning that ‘[s]uch considerations are peculiarly within the province and professional expertise of corrections officials, and, in the absence of substantial evidence in the record to indicate that the officials have exaggerated their response to these considerations, courts should ordinarily defer to their expert judgment in such matters.’
Id., 441 U.S. at 540 n. 23, 99 S.Ct. at 1875 n. 23 (quoting Pell v. Procunier, 417 U.S. 817, [992]*992827, 94 S.Ct. 2800, 2806, 41 L.Ed.2d 495 (1974)).
Finally, in applying these constitutional principles to the facts of the Bell case, the Court articulated the following standard for determining when untoward conditions of confinement are such as to be arguably excessive in relation to the purpose of managing the facility:
confining a given number of people in a given amount of space in such a manner as to cause them to endure genuine privations and hardship over an extended period of time might raise serious questions under the Due Process Clause as to whether those conditions amounted to punishment.
Bell v. Wolfish, supra, 441 U.S. at 542, 99 S.Ct. at 1875-1876.
Thus, in determining in the present case whether conditions at the Jail are such as to amount to punishment, which would violate the due process rights of pre-trial detainees, we must ask, first, whether any legitimate purposes are served by these conditions, and second, whether these conditions are rationally related to these purposes. In assessing whether the conditions are reasonably related to the assigned purposes, we must, further, inquire as to whether these conditions “cause [inmates] to endure [such] genuine privations and hardship over an extended period of time,” that the adverse conditions become excessive in relation to the purposes assigned for them. Id.
B.
On January 29, 1982, the district court, having before it motions by the County and the Commissioner to vacate the consent judgment, a motion by the inmates to hold the County in contempt of the consent judgment, and the motion by the County for a preliminary injunction ordering the Commissioner to remove state prisoners, and with the benefit of the New Jersey Supreme Court’s ruling in Worthington v. Fauver, 88 N.J. 183, 193, 440 A.2d 1128 (1982), determined that “the court is desperately in need of detailed information on the jail conditions as well as what efforts were or could have been made to abide by the consent order.” App. 55a. To acquire this information, the district court thereupon appointed as Special Master the Honorable Worrall F. Mountain, a former Justice of the New Jersey Supreme Court10 and a member of Governor Byrne’s Task Force on Prison Overcrowding. App. 56a.
Justice Mountain made a tour of the facility on February 8,1982, interviewed officials, administrators, corrections officers, and inmates, took testimony from state correctional officials, held discussions with counsel, and considered affidavits and other documents. App. 65a. On March 1, 1982, he filed a report setting forth proposed findings of fact, conclusions of law, and remedial recommendations. App. 63a-98a. The district court, noting thát pursuant to Fed.R.Civ.P. 53(e) the Special Master’s findings must be accepted unless clearly erroneous, Union County, supra, 537 F.Supp. at 998, adopted them without modification. Id. at 1001.
The Special Master found, App. 80a, and the district court specifically agreed, “that there has been no express intent to punish the inmates at the UCJ on the part of either the defendants or the third-party defendant.” Union County, supra, 537 F.Supp. at 1002. This finding has not been questioned by any of the parties. Thus, we may proceed directly to the second step of the two-step Bell inquiry, and determine whether a legitimate purpose or purposes may be assigned for conditions at the Jail, and whether those conditions are excessive in relation to their purpose or purposes.
The district court held in substance that the effective management of a detention facility during a statewide prison overcrowding emergency, along with “the interests of local and state governments in not releasing [inmates] onto the streets,” Union County, supra, 537 F.Supp. at 1003, were the two relevant legitimate governmental [993]*993interests that might justify conditions at the Jail. Id. at 1002-03.
It is plain that there is a legitimate governmental interest in “effective management of [a] detention facility.” Bell v. Wolfish, supra, 441 U.S. at 540, 99 S.Ct. at 1874. Yet, as the division of interests in this case between the County and the Commissioner reveals, “effective management of a detention facility during a statewide prison overcrowding emergency” serves two distinct governmental interests. First, the State of New Jersey has an interest, validated by the New Jersey Supreme Court in Worthington v. Fauver, supra, in “efficiently allocating] inmates of state and county penal and correctional institutions to those institutions having available space in order to alleviate [statewide] overcrowding.” Worthington v. Fauver, supra, 88 N.J. at 191, 440 A.2d at 1131 (quoting Executive Order No. 106 (Byrne)). Second, the County has an interest in “effectively managing the detention facility,” even though, as the third-party complaint discloses, in some respects this interest is distinct from and adverse to the State’s interest in allocation of space. However, given that the State has invoked its interest in allocation of space to require the County to retain state prisoners, the County’s effective management of the Jail must include management of the resultant overcrowded institution, and the two governmental interests to that extent coincide.
The district court was also correct in concluding that “the interests of local and state governments in not releasing onto the streets either pretrial detainees who are not bail worthy or convicted inmates, are legitimate ones.” Union County, supra, 537 F.Supp. at 1003. See Bell v. Wolfish, supra, 441 U.S. at 539-40, 99 S.Ct. at 1874-75.
Thus, the district court properly proceeded to consider whether the conditions and restrictions of the Jail were rationally connected to these valid objectives and whether the conditions and restrictions were excessive in relation to these objectives. See Bell v. Wolfish, supra, 441 U.S. at 538, 99 S.Ct. at 1873. The district court found that the overcrowding at the Jail was rationally connected to the objective of not releasing inmates. It also found that the conditions resulting from overcrowding were “an unavoidable incident of the jail officials’ efforts to effectively’ manage the facility during a statewide prison overcrowding emergency.” Union County, supra, 537 F.Supp. at 1002 (quoting the Special Master’s Report). Thus, in effect, the district court found that the overcrowding was rationally connected to and served both state and county governmental interests. These findings are not questioned on this appeal.
C.
The only question thus remaining in the Bell inquiry is whether the conditions and restrictions resulting from inmate overcrowding can be considered excessive in relation to the purposes assigned for them. See Bell v. Wolfish, supra, 441 U.S. at 538, 99 S.Ct. at 1873. In this connection, the Special Master, after discussion of the Bell standard, found
The totality of the overcrowding conditions at the jail, e.g., the unsuitable and unsanitary sleeping conditions resulting from inmates being forced to sleep on mattresses, the almost complete absence of recreational facilities, the cutbacks in visitation, the delays encountered in administering inmate programs, the inadequate lighting in the cellblocks, the inability to provide clean inmate clothing in accordance with N.J.A.C. 10A:31-3.-13(b)(5), and the absence of a medical screening procedure for new inmates, amount to “genuine privations and hardship.”
App. 81a-82a.
The Special Master recommended that the court hold that these privations and hardships “cannot be justified by the mere fact that a statewide prison overcrowding problem exists.” App. 82a. The Special Master also recommended that the court hold that each of six specific conditions at the Jail constituted punishment,11 when [994]*994considered in the light of the totality of the circumstances at the Jail. App. 82a-83a.
By the terms of the order appointing the Special Master, the parties were given ten days after the filing of his report to file objections to that report. The County filed no objections, and neither did the inmates. The Commissioner did file objections, which focussed largely on the Special Master’s refusal to accept certain remedial recommendations of the Department of Corrections. See App. 100a-101a. The Commissioner specifically noted that “[t]he State does not assert that it is proper for the County to require inmates to sleep on mattresses on the floor.... So the Special Master properly recommended that the floor mattresses practice should be eliminated.” App. 122a.
At a hearing which was held on March 25, 1982, the district court considered the Commissioner’s objections. The Attorney General, representing the Commissioner, argued that double-bunking combined with measures promised by the County would cure any constitutional violations, and that the State needed more time to absorb any state prisoners to be transferred.12 The State’s position was that, if, as the Commissioner proposed, inmates were double-bunked, adequate space and recreational facilities would be afforded. In that manner, the constitutional standard of Bell 'v. Wolfish would be satisfied.13
From these rather extended proceedings, which culminated in the district court’s order of April 27, 1982, two conclusions emerge. First, from the positions taken by the County and the Commissioner, we do not understand either of them seriously to contest the unconstitutionality, in the context of overcrowded conditions, of forcing pre-trial detainees to sleep for more than a few days on mattresses placed on the floor of a 5' X 7' cell adjacent to an open toilet which both cellmates must use. Indeed, the County conceded, at oral argument before this court, that conditions as found by Justice Mountain were unconstitutional. Thus, the district court’s implicit holding that conditions as found by the Special Master are “excessive in relation to the purposes assigned to them,” is not questioned on this appeal.
Our second conclusion is that, of all the various conditions challenged as being unconstitutional, the most significant, and indeed the only condition not meeting constitutional standards, was the practice of placing a mattress on the floor for the second occupant of a cell designed for but one inmate. It is not surprising, therefore, that the Commissioner focussed on an alleviation of this latter condition by recommending double-bunking in such cells. The Commissioner contended that if, by providing double bunks, and by holding the County to its obligations under the consent agreement, constitutional objections to overcrowding could be overcome, then the Commissioner’s discretion in determining where state prisoners should be placed, should not be overridden. We therefore turn to a consideration of the two-in-a-cell or double-bunking practice, as resolution of that issue will determine the outcome of this appeal.
[995]*995D.
The district court held, first, that “based solely on considerations of space ... double-bunking at the [Jail] subjects pretrial detainees to genuine hardships amounting to punishment,” Union County, supra, 537 F.Supp. at 1005, and, second, that, under the totality of circumstances at the Jail, double-bunking violates the due process rights of pretrial detainees. Id. at 1006-07.
The Commissioner argued that, if the general population cells in Jail were equipped with double bunks, then both the unconstitutional accommodations and the lack of recreational space would be remedied. App. 178a-79a. The Commissioner emphasized that even at the highest recorded population figure for the Jail less than three quarters of the 218 general population cells would have to be double-bunked,14 and the district court assumed that one-half of the cells would need to be double-bunked. Union County, supra, 537 F.Supp. at 1005. The Commissioner noted that if this were done the temporary dormitories could be removed from the former recreational areas, resulting in more than doubling the areas available for recreation. App. 190a. Finally, the Commissioner contended that the County could provide clean clothing weekly and medically screen all new inmates, even with the increased population resulting from double-bunking. App. 192a-93a.15 At oral argument before this court, the County contended that it had implemented an adequate medical screening program and that it had undertaken to procure supplies necessary for meeting the requirement for clean clothes. Thus, it would appear that the Commissioner’s contention, that the County could provide clean clothes and medical screening, even with double-bunking, is well founded and not opposed by the County.
However, as noted, the district court rejected this remedial scheme put forth by the Commissioner on two separate grounds, first, that conditions would still violate the due process rights of detainees because of sheer lack of space, and second, that conditions would still violate their rights when the totality of circumstances in the Jail was considered. Union County, supra, 537 F.Supp. at 1005-07. We will consider these grounds in succession.
The record reveals that, even when double-bunked, the admittedly rather small cells at the Jail provide adequate space for sleeping, and thus, in the words of Justice Rehnquist in Bell v. Wolfish, “we fail to understand the emphasis of [the district court] on the amount of walking space in the ‘double-bunked’ rooms.” Bell v. Wolfish, supra, 441 U.S. at 543 n. 26, 99 S.Ct. at 1876 n. 26.
With respect to the space available outside the cells the County was ordered to “provide at least one hour of recreation [996]*996daily to each inmate.” Union County, supra, 537 F.Supp. at 1015. Moreover, on the assumption that cells would be double-bunked, the former recreation areas were to be reclaimed. Based on the Special Master’s finding, this reconstituted recreation area would be over 1,700 square feet in area. App. 68a, 89a. Thus, for at least one hour daily, inmates would have the use of an enlarged space. As for the space available to inmates during the remaining waking hours, the Special Master calculated that the square footage available per inmate, when one-half of each tier of cells is double-bunked, would vary from 41 to 45 square feet, depending on the number of cells. App. 72a. When, as has been done on several tiers of the Jail, for reasons not explained in the record, the entire tier has been double-celled, the available square footage per inmate (including his share of his own cell) varies from 31 to 33.5 square feet. Id. This is indeed a “cramped and overcrowded” space, App. 84a (Special Master’s description), and very far from ideal. Yet the mitigating effects of larger recreational space for at least an hour a day must also be recognized. See Bell v. Wolfish, supra, 441 U.S. at 543, 99 S.Ct. at 1876.
With the adoption of these recommendations, it is apparent that inmates would have adequate room for sleeping and a genuine opportunity for at least an hour of recreation. In this light, we find the spatial analysis employed by the district court unilluminating and unconvincing. It may be that confining detainees to a small space for much of the time could amount to “punishment,” but if so, such a conclusion must be based on a qualitative and not a quantitative assessment of the resulting environment. Thus, for this reason we reject the district court’s holding of unconstitutional conditions “based solely on considerations of space,” Union County, supra, 537 F.Supp. at 1005.
E.
We proceed, therefore, to consider whether, under the totality of circumstances at the Jail as it would be under the Commissioner’s proposed solution, overcrowding would be deemed to amount to punishment.16 We recognize that this question is not an easy one, for although the Supreme Court held that, under the circumstances described in Bell v. Wolfish, “nothing even approaching [the degree of hardship which would ‘raise serious questions under the Due Process Clause’] is shown,” Bell v. Wolfish, supra, 441 U.S. at 542, 99 S.Ct. at 1876, conditions at the Jail are evidently much worse than at the relatively spacious and modern facility in question in Bell. Focussing, however, upon the crucial constitutional findings of the Special Master, we are convinced that overall the remedial scheme proposed by the Commissioner passes constitutional muster.
First, and most importantly, providing double bunks will avoid the unsanitary and humiliating practice of forcing detainees to sleep on mattresses placed either on the floor adjacent to the toilet and at the feet of their cellmates, or elsewhere in the Jail. Second, double-bunking will avoid the practice of having more than two detainees without adequate sleeping arrangements in the detention cells. Third, double-bunking will make it possible for recreational areas at the Jail to be cleared and dedicated to their original function. Thus, the remedial scheme put forth by the Commissioner, combining double-bunking with discharge of the County’s obligations under the consent judgment, would effectively cure all of the conditions that were of particular concern to the Special Master.17 Moreover, our [997]*997own review of the record convinces us that pre-trial detainees are confined at the Jail “for generally a maximum period of 60 days.” Bell v. Wolfish, supra, 441 U.S. at 543, 99 S.Ct. at 1876.18
Thus, although the question is not without difficulty, we are satisfied that, if the Commissioner’s proposals, described above, were fully implemented, conditions at the Jail would pass constitutional muster. Bell v. Wolfish, supra, 441 U.S. at 541-43, 99 S.Ct. at 1875-1876.
V.
Sentenced Inmates
In Rhodes v. Chapman, 452 U.S. 337, 101 S.Ct. 2392, 69 L.Ed.2d 59 (1981) the Supreme Court considered “for the first time the limitation that the Eighth Amendment ... imposes upon the conditions in which a State may confine those convicted of crimes.” Rhodes v. Chapman, supra, 452 U.S. at 344-45, 101 S.Ct. at 2397-98. The Court stated that
No static ‘test’ can exist by which courts determine whether conditions of confinement are cruel and unusual, for the Eighth Amendment ‘must draw its meaning from the evolving standards of decency that mark the progress of a maturing society.’ Trop v. Dulles, 356 U.S. 86, 101 [78 S.Ct. 590, 598, 2 L.Ed.2d 630] (1958) (plurality opinion).
Rhodes v. Chapman, supra, 452 U.S. at 346, 101 S.Ct. at 2399. The Court went on to emphasize that Eighth Amendment “ ‘judgment^] should be informed by objective factors to the maximum possible extent.’ ” Rhodes v. Chapman, supra, 452 U.S. at 346, 101 S.Ct. at 2399 (quoting Rummel v. Estelle, supra [445 U.S. 263] at 274-275 [100 S.Ct. 1133 at 1139, 63 L.Ed.2d 382 (1980) ] which quoted Coker v. Georgia, supra [433 U.S. 584] at 592 [97 S.Ct. 2861 at 2866, 53 L.Ed.2d 982 (1977) ] (plurality opinion)).
Noting that the same principles apply “when the conditions of confinement compose the punishment at issue,” Rhodes v. Chapman, supra, 452 U.S. at 347, 101 S.Ct. at 2399, the Court went on to characterize the circumstances under which such conditions might be held to constitute cruel and unusual punishment:
Conditions must not involve the wanton and unnecessary infliction of pain, nor may they be grossly disproportionate to the severity of the crime warranting imprisonment .... In Hutto v. Finney, 437 U.S. 678 [98 S.Ct. 2565, 57 L.Ed.2d 522] (1978), the conditions of confinement in two Arkansas prisons constituted cruel and unusual punishment because they resulted in unquestioned and serious deprivations of basic human needs. Conditions other than those in Gamble and Hutto, alone or in combination, may deprive inmates of the minimal civilized measure of life’s necessities. Such conditions could be cruel and unusual under the contemporary standard of decency that we recognized in Gamble. 429 U.S. [97] at 103-104 [97 S.Ct. 285 at 290-291, 50 L.Ed.2d 251]. But conditions that cannot be said to be cruel and unusual under contemporary standards are not unconstitutional. To the extent that such conditions are restrictive and even harsh, they are part of the penalty that criminal offenders pay for their offenses against society. Rhodes v. Chapman, supra, 452 U.S. at 347, 101 S.Ct. at 2399 (emphasis added).
[998]*998B.
In the present case, the Special Master recommended that the district court hold conditions at the Jail to be in violation of the Eighth Amendment in two respects.19 He opined, first, that requiring two or more sentenced inmates to sleep for extended periods on mattresses laid on the floor of the detention cells amounts to “wanton and unnecessary punishment,”20 and, second, that requiring sentenced inmates to sleep on mattresses placed on the floor “is so reprehensible and dehumanizing a practice when carried out for extended periods of time” that it violates the Eighth Amendment by inflicting “ ‘unnecessary and wanton’ physiological and psychological pain.” App. 87a-88a.
The district court also held that requiring sentenced inmates to sleep for long periods of time on mattresses placed on the floor was “a ‘reprehensible and dehumanizing practice.’ ” Not following the Special Master’s legal analysis, however, it went on to hold that such a practice “deprives these inmates of the essential requirement of habitable shelter,” and that in consequence this practice violates the Eighth Amendment. Union County, supra, 537 F.Supp. at 1008.
Going further, however, the district court also held “that 30 square feet of daytime space or 19.5 square feet of sleeping space fails to meet any contemporary standard of decency especially in light of the impact overcrowding has had on visitation, recreation, and time off the tier.” Id.21 In consequence, the district court held that conditions even under the Commissioner’s remedial scheme involving double-bunking, would constitute cruel and unusual punishment. Id. at 1008-09. We do not agree.
Here, as in the case of the pre-trial detainees, the Commissioner did not defend the constitutionality of forcing sentenced inmates to sleep on mattresses laid on the floor next to toilets. Rather, the Commissioner argued, without qualification, that the court should “direct the County to follow the recommendations of the Department to use bunk type beds in the general population cells and detention cells and thereby eliminate the use of floor mattresses in the jail.” App. 195a. Similarly, on this appeal, the Commissioner, implicitly conceding the undesirability of placing mattresses on the floor, attacks only the further holding of the district court, that even double-bunking at the Jail would violate the Eighth Amendment, and argues that the district court erred by so holding on the basis of spatial considerations alone. See Appt. brief 18-19.
Having sustained the constitutionality of the Commissioner’s remedial scheme, involving double-bunking and the County’s obligations under the consent judgment with respect to pretrial detainees, a fortiori, we must hold that the same provisions meet constitutional standards for sentenced inmates, under the principles of Rhodes v. Chapman. See Inmates of Allegheny County Jail v. Pierce, 612 F.2d 754, 762 (3d Cir.1979) (if Eighth Amendment standard violated, due process standard applicable to pre-trial detainees must also be violated). See also Gibson v. Lynch, 652 F.2d 348, 352 (3d Cir.1981). Nevertheless, recognizing that the district court was faced with the necessity of grappling with a different constitutional standard in the context of sentenced inmates, we deem it appropriate briefly to consider the district court’s holding with regard to the “minimal civilized [999]*999measure” of “habitable shelter” under the Eighth Amendment. Union County, 537 F.Supp. at 1008.
1.
The district court, relying upon Battle v. Anderson, 564 F.2d 388 (10th Cir.1977) and Ramos v. Lamm, 639 F.2d 559 (10th Cir.1980), rested its holding with regard to the basic necessity of “shelter” solely upon the following consideration:
the stark reality is that 30 square feet of daytime space or 19.5 square feet of sleeping space fails to meet any contemporary standard of decency especially in light of the impact overcrowding has had on visitation, recreation and time off the tier.
Union County, supra, 537 F.Supp. at 1008.
The test which we must apply in reviewing the district court’s determination that sentenced inmates would be subjected to cruel and unusual punishment under the Commissioner’s double-bunking proposal is whether the resulting “conditions ..., alone or in combination, [ ] deprive inmates of the minimal civilized measure of life’s
necessities.” Rhodes v. Chapman, 452 U.S. at 347, 101 S.Ct. at 2399. The “necessity” of which the inmates were held to be deprived in this case is the necessity of “habitable shelter,” as measured under “contemporary standards of decency.”22 Union County, supra, 537 F.Supp. at 1008. The totality of circumstances relevant to this inquiry comprises all those circumstances that bear on the nature of the shelter afforded to sentenced inmates. See Hoptowit v. Ray, 682 F.2d 1237, 1247 (9th Cir.1982).23 We believe that, just as the district court in Hoptowit erred, in this case the district court has also erred by “relypng] exclusively on per capita square footage recommendations.” In doing so, it failed to consider the totality of the circumstances relevant to determining whether conditions have fallen to the “level at which the shelter of inmates is unfit for human habitation.” Hoptowit v. Ray, 682 F.2d at 1249.24 Rather, the district court here, relying upon the holding of the Tenth Circuit in Battle, supra, held that “30 square feet of daytime space or 19.5 square feet of sleeping space” was constitutionally inadequate as shelter. Union County, 537 F.Supp. at 1008.25 Yet even [1000]*1000the apparently per se rule requiring 60 square feet per inmate, adopted by the Tenth Circuit in Battle, 564 F.2d at 395, was adopted as a necessary remedial measure in the face of long-continued conditions of confinement that were plainly much worse than those facing inmates at the Jail.26
In the instant case, the district court failed to consider that the sentenced inmates spend much less time at the Jail than did the prisoners in question in Rhodes, “67% of whom were serving life or other long-term sentences.” Rhodes v. Chapman, supra, 452 U.S. at 341, 101 S.Ct. at 2396.27 Yet, as the Supreme Court, and the courts of appeal have repeatedly recognized in Eighth Amendment challenges, “the length of confinement cannot be ignored in deciding whether the confinement meets constitutional standards.” Hutto v. Finney, 437 U.S. 678, 686, 98 S.Ct. 2565, 2571, 57 L.Ed.2d 522 (1978).
We would have to wrench the Eighth Amendment from its language and history to hold that delay of these desirable aids to rehabilitation violates the Constitution.
2.
Further, the overall length of confinement is only one factor among several that must be considered by a district court, in evaluating the totality of circumstances relevant to any alleged constitutional deficiency in shelter. “Neither the number of inmates in one cell nor the amount of space provided for an inmate in a dormitory alone determines whether confinement is cruel and unusual.” Ruiz v. Estelle, 679 F.2d 1115, 1146 (5th Cir.1982). Also relevant is how much time prisoners must spend in their cells each day,28 see Hoptowit v. Ray, 682 F.2d at 1249, the opportunities for inmate activities outside of the cells,29 and the [1001]*1001general state of repair and function of the facilities provided.30
3.
We therefore conclude that the district court erred in holding conditions at the Jail, as they would be if the double-bunking remedial scheme proposed by the Commissioner were adopted, to be in violation of the Eighth Amendment. If sentenced inmates were double-celled and provided with bunk-type beds of their own, and if the County discharged its duties under the consent judgment, as it was obliged to do, then there can be no doubt that the resulting conditions would not “deprive inmates of the minimal civilized measure of” shelter. Rhodes v. Chapman, 452 U.S. at 347, 101 S.Ct. at 2399.
VI.
Remedy
“Although a district court has wide discretion in tailoring a remedial injunction, that discretion is not unconfined.” Ruiz v. Estelle, 679 F.2d at 1144-45. The Supreme Court and the courts of appeal have articulated several limiting principles that must guide the district court in fashioning appropriate relief.
First, and perhaps most importantly, the Eighth Amendment does not give a federal court “a roving commission to impose upon the [correctional institutions of New Jersey its] own notions of enlightened policy.” Rummel v. Estelle, 445 U.S. 263, 285, 100 S.Ct. 1133, 1145, 63 L.Ed.2d 382 (Stewart, J., concurring) (1980). Rather, “ ‘the nature of the violation determines the scope of the remedy.’ Therefore, a court can order only relief sufficient to correct the violation found.” Ruiz v. Estelle, 679 F.2d at 1145 (quoting Swann v. Charlotte-Meeklenburg Bd. of Educ., 402 U.S. 1, 16, 91 S.Ct. 1267, 1276, 28 L.Ed.2d 554 (1971). Neither may the court “use the totality of all conditions to justify federal intervention requiring remedies more extensive than are required to correct Eighth Amendment violations.” Wright v. Rushen, 642 F.2d 1129, 1133 (9th Cir.1981).
Second, “the federal courts in devising a remedy must take into account the interests of state and local authorities in managing their own affairs, consistent with the Constitution.” Milliken v. Bradley, 433 U.S. 267, 280-81, 97 S.Ct. 2749, 2757-58, 53 L.Ed.2d 745 (1977). What this means in practice is that “state and local authorities have primary responsibility for curing constitutional violations.” Hutto v. Finney, 432 U.S. at 687 n. 9, 98 S.Ct. at 2572 n. 9. [1002]*1002It is when these “ ‘authorities fail in their affirmative obligations ... [that] judicial authority may be invoked.’ ” Hutto v. Finney, 432 U.S. at 687 n. 9, 98 S.Ct. at 2572 n. 9, (quoting Milliken v. Bradley, 433 U.S. at 281, 97 S.Ct. at 2757).
The district court in this case ordered the Commissioner “to remove any and all inmates incarcerated at the Union County Jail who as of fifteen (15) days prior to that date [July 1, 1982] have been sentenced to terms of imprisonment in state facilities; and ... fully [to] comply with N.J.S.A. 2C:43-10(e) [providing for removal of state prisoners within fifteen days of sentencing] with respect to persons who are or shall be incarcerated at the Union County Jail.” Union County, 537 F.Supp. at 1015.
This order is in express contravention of Executive Orders, issued by Governors Byrne and Kean, that suspend operation of N.J.Stat.Ann. 2C:43-10(e) (West 1982) and confer upon the Commissioner discretion to designate the place of confinement for state prisoners. Relying upon its authority under the Fourteenth and Eighth Amendment and the Supremacy Clause, however, the district court held that
[t]he administrative action designating the UCJ as the place of confinement of state sentenced inmates is void and N.J. S.A. 2C:43-10(e) shall be given full force and effect.
Union County, 537 F.Supp. at 1009. This holding is based, in turn, upon the district court’s conclusion that conditions in the Jail would violate the Fourteenth and Eighth Amendments even if the double-bunking scheme proposed by the Commissioner were implemented. For, only if conditions in the Jail could not be rendered constitutional without reduction of the population, would removal of the state prisoners be required as a constitutional remedy.
We have concluded, however, that the district court erred when it held that the Commissioner’s remedial scheme, if implemented by the County and the State, would not cure existing Fourteenth and Eighth Amendment violations. Thus, the crucial constitutional predicate for the court’s order is lacking.
The Commissioner, in the exercise of his “primary responsibility for curing constitutional violations,” Hutto v. Finney, 437 U.S. at 687 n. 9, 98 S.Ct. at 2572 n. 9, has in due course and in evident good faith come forward at the earliest opportunity with a remedial scheme to cure the violations found by the Special Master. Under the governing standards of Bell v. Wolfish and Rhodes v. Chapman, the Commissioner’s recommendation, once implemented, would cure the due process and Eighth Amendment violations that have been found to exist in the Jail. This is not, therefore, a case in which “[t]he District Court had given the [Commissioner] repeated opportunities to remedy the [unconstitutional] conditions in the ... cells.” Hutto v. Finney, 437 U.S. at 687, 98 S.Ct. at 2572.
It has been argued in support of the district court’s order that the remedy ordered by the district court is actually less intrusive than the recommendations made by the Commissioner. Brief of PlaintiffsAppellees at 50-52. This is said to be so because a single order to remove an easily identifiable group of inmates may be carried out with less interference in administration of day-to-day operation of the Jail than would be required to implement the double-bunking scheme urged by the Commissioner. We emphasize, however, that the intrusiveness of an order cannot be assessed apart from its impact on the state authorities involved. There can be no question, in light of the fundamental “interests of state and local authorities in managing their own affairs,” Milliken v. Bradley, 433 U.S. at 281,97 S.Ct. at 2757, that a constitutionally adequate remedial scheme developed by the responsible officials and carried out within the context of existing state institutional structures, would be far less intrusive than a remedy imposed on those officials against their own administrative judgment by means of the abrogation of state institutional arrangements.
[1003]*1003VII.
We therefore hold that the district court, in its zeal to correct what it perceived as unconscionable conditions, improperly exercised its discretion by rejecting the Commissioner’s proposed remedial scheme and by ordering the removal of state prisoners from the county facility. Accordingly, we will reverse and remand this case to the district court with the following directions, with regard to the district court’s order of April 27, 1982. Union County, 537 F.Supp. at 1014-15. The district court is directed:
I. To vacate paragraph (1) (ordering removal of state prisoners by July 1, 1982); and
II. To vacate paragraph (2) (ordering compliance with N.J.Stat.Ann. 2C:43-10(e) (West 1982) despite suspension of this fifteen-day removal provision by Executive Order); and
III. To vacate paragraph (f) (confirming the “maximum capacity” for the Jail), paragraph (g) (giving the Commissioner until July 1, 1982 to achieve that population figure), and paragraph (h) (empowering the County to “notify the Department of Corrections to remove any state prisoners who have remained at the facility beyond the statutory fifteen (15) day period since sentence was imposed”) of the October 22,1981 consent judgment, which paragraphs are incorporated into and made part of the April 27, 1982 order. Union County, 537 F.Supp. at 1015.
As for the remaining portions of the April 27, 1982 order, we will remand to the district court for reconsideration and modification, if necessary, in light of our foregoing discussion, and for such other proceedings as are consistent with this opinion. We point out as well that, because changes not reflected in the record before us may have occurred in the time that has elapsed since the district court entered its April 27, 1982 order, the district court, if in its discretion it should deem necessary, should not regard itself as precluded by this opinion from supplementing the record. In particular, the court may wish to develop further the manner, and time, in which the Commissioner’s remedial proposals are to be implemented, and may itself take any other steps it deems necessary to require compliance with the constitutional mandates of Bell and Rhodes as we have construed them in this opinion.