Like other big-city jails, Philadelphia's prisons teem with all kinds of accused wrongdoers, from violent gun criminals to people arrested for disorderly conduct.
But, until recently, all new arrivals at the State Road prisons got the same treatment: Everyone was forced to strip naked for a search.
That may end up costing the city millions. Lawyers for former inmates have filed a class-action suit, saying tens of thousands of minor offenders were made to strip illegally.
Federal courts have long made it clear that strip searches, because they're so demeaning, must be used with care.
Strip-searching everyone, regardless of the offense or the security risk, violates the constitution, courts have ruled.
But that was the policy of the Philadelphia prison system for at least two decades, ending only in October.
"We thought what we were doing was right," Michael Resnick, chief of staff for the jails commissioner, said in a recent interview.
The goal of the strip searches, he said, was to keep drugs and contraband out of the city's perennially overcrowded prisons.
Resnick also said U.S. District Judge Norma Shapiro signed off on the strip-search policy; the troubled jails system is under court supervision.
But the prisons' own records offer little proof that the strip searches were effective.
The city reviewed 400 prisoners' files for the lawsuit and said guards found contraband in 132 cases.
Of those, there were only seven cases where strip searches found prisoners hiding drugs, cigarettes or money in their underwear or orifices - suggesting that the contraband was entering the prison in other ways.
Two strip searches did turn up weapons, a homemade knife and a razor. But they were found on prisoners who had long been in the prison population, and there's no telling where they came from.
The prison lawsuit was filed in 2005, but city jail officials, insisting their policy was correct, continued to conduct blanket strip searches for two more years.
Jails officials finally changed course in October. Now, suspects are screened first with metal detectors and drug detection machines.
The preliminary results show that at least three-fourths of the inmates were in fact clean.
Metal detectors found nothing, prison spokesman Robert Eskind said. The drug-sniffing machines, often criticized for false readings, went off for about a fourth of the incoming inmates, and they were strip-searched, he said.
Now, lawyers for the city and the inmates have opened settlement talks, debating in legal briefs how many inmates were illegally strip searched - and how much the payout should be.
Lawyers for the inmates, fresh from securing a $7.5 million settlement agreement in a similar suit in Camden, say as many as 60,000 Philadelphia inmates were wrongly strip-searched during the last three years. They are seeking $15 million.
The city called the number "patently unreasonable" because Philadelphia was "struggling to maintain basic services to taxpayers," and argued that that the number of people illegally strip-searched was no more than 20,000.
City lawyers declined to comment.
Washington attorney Charles LaDuca is a veteran of these cases; he's part of a legal team that has five other suits pending in Pennsylvania and South Jersey.
He applauds the city's new restrictions on searches but says they took far too long.
"Blanket strip searches are unconstitutional, and it was Philadelphia's policy," he said. "It's difficult to defend that."