LIFE, which in Alabama really means life, is better than it once was at the St Clair Correctional Facility, a maximum-security jail near Birmingham. In 1985 prisoners rioted over what they called barbaric conditions, taking 22 hostages, breaking the warden's jaw and beating his deputy so badly that he lost all memory of the assault. Six years ago, six dangerous inmates escaped under a faulty lethal electric fence. All six were recaptured, but angry Alabamians demanded that someone sort the jail out.

That someone was Ralph Hooks, the new warden who took over just after the escape. He tightened up security, adding ten miles (16km) of razor wire and a fence that trips an alarm if climbed on or tampered with. But perhaps more importantly, he tried to make the jail a less horrible place to be locked up in. When he arrived, he found that a few officers were handcuffing and beating inmates to punish them. One was demanding protection money from an inmate's family. Mr Hooks sacked or suspended all the abusers he could catch, and one was prosecuted.

Now, he reckons, the prisoners feel they are treated fairly, and are less likely to riot. If an inmate has a grievance, he can come and discuss it face to face with the warden. Inmates (see above) even teach each other to read. A slight man on the point of retirement, Mr Hooks mingles fearlessly with hundreds of muscular, tattooed prisoners, who address him with respect and an occasional smile.

Under Mr Hooks, the jail is no longer barbaric. But it is still grim. For a start, it is over-crowded. Three sweaty thugs are often crammed into a 69-square-foot (six-square-metre) cell with little light and no air-conditioning. In the Alabama summer it is fearfully hot. “If we had air-conditioning, we'd maybe have fewer fights,” says Mr Hooks, but there is no chance, he reckons, that the Alabama legislature will give him the money. Schools, roads and the needs of law-abiding folk come first.

But law-abiding folk would presumably prefer not to be mugged or murdered, so they ought to care whether prison conditions make that more or less likely. Obviously, jail takes criminals off the streets. What is less clear is whether tough conditions in jail reduce crime beyond that, by acting as a deterrent, or raise it, by brutalising prisoners and making them more prone to re-offend once released.

Two studies draw contrary conclusions. Lawrence Katz, Steven Levitt and Ellen Shustorovich examined the death rate in American jails (excluding executions) as a proxy for harsh conditions. After looking at data in every state between 1950 and 1990, they estimated that each death in prison was associated with between 30 and 98 fewer violent crimes being committed. They concluded that tough conditions do deter potential criminals, though they cautioned that this did not necessarily mean they were desirable, since even criminals have rights.

Keith Chen of Yale and Jesse Shapiro of the University of Chicago approached the problem another way. They recently compared the experiences of prisoners who were nearly-but-not-quite bad enough to be put in a high-security jail with those only just bad enough to be in one. These two groups, they assumed, would be similar in temperament; but those in higher-security jails would endure a harsher regime and nastier cellmates.

By comparing recidivism rates for the two groups, Messrs Chen and Shapiro estimated whether tough conditions made bad men worse. They concluded that they did: similar prisoners held in higher security jails were 10-15 percentage points more likely to be re-arrested after being released. Since they estimated this effect to be larger than the deterrent effect identified by Mr Katz and co., they concluded that humane jails make for safer streets.

Mr Hooks reckons that it all depends on the individual. Good conditions may help one inmate re-enter society; a Spartan environment may deter another, he says. Personally, he bends towards rehabilitation rather than punishment. Inmates at St Clair are offered drug treatment and job training. There is a well-stocked law library—“so they know how to sue me,” he chuckles. Some Alabamians complain that taxpayers' money should not be wasted on educating criminals. Mr Hooks says he asks such people whether they would prefer the ex-con next door to be unskilled and jobless. Alabama's current commissioner of prisons, Richard Allen, is also keen on rehabilitation. In April, noting that 95% of prisoners are eventually released, he announced a new programme to help them find a place to live, a job and help with staying off drugs.

But for those still behind bars overcrowding remains a serious problem, and not only in Alabama. Thanks largely to tougher sentencing, the number of prisoners in America exploded from 500,000 in 1980 to 2.3m in 2006. Although the rising ratio of prisoners to the general population has been levelling off since 2000, the absolute number is still growing steadily (see chart).

Overcrowding could be eased by jailing fewer people or by building more cells. Leniency is unpopular, however, even though non-violent drug offenders make up between a fifth and a quarter of prisoners, and many could be treated rather than jailed without endangering the public. Building new prisons, meanwhile, is costly. California decided last year to spend $7.8 billion to expand its prisons, but still the plan was struck down by judges this week as unworkable. Some states, including California, are finding that they can save money by making more use of private prisons.

This is controversial. But contrasting St Clair with a prison operated by the Corrections Corporation of America (CCA) suggests that it may not be a bad idea. Their facility in Tutwiler, Mississippi, is light and air-conditioned where St Clair is dark and steaming. It is less crowded and has a freshly-painted feel; St Clair is shabby and peeling. The sports facilities are better. “We try to wear them out so they go to sleep—like you do with your kids,” says the warden, Robert Adams.

Inmates who have tasted both public and private lock-ups say they prefer the latter. “You've more things in CCA. More programmes. Better rec[reational facilities],” says Anthony Palabay, the sex offender in charge of in-jail movies. (Films with too much sex or racial tension are barred.)

The main reason states contract with private jailers is to cut costs. Tony Grande, a vice-president at CCA, says his firm typically charges 5-15% less per prisoner than a state would spend. The firm has economies of scale—it guards more prisoners than any state bar California, Texas or Florida. It can assemble a jail quickly and cheaply using standardised parts. It lacks a state's cumbersome bureaucracy. It builds smart jails, where fewer staff can watch more prisoners, and it builds where land and labour are cheap.

Private prisons are cheaper and at least as humane as public ones. But one way they curb costs is to take prisoners from any state that has more than it can handle and lock them up wherever they have spare capacity. Mr Adams, for example, guards a crowd of Hawaiians and is expecting an influx of Californians soon. This matches supply with demand, but holding prisoners so far from home that their families can probably never visit seems unduly harsh. The Hawaiians at Tutwiler can talk with their loved ones via a video link-up, but can hug them only if they can afford the air fare.