When a crime is committed there's often talk of the criminal owing a debt to society - paid back through community service, fines or a prison term. But in Philadelphia, offenders are leaving prison owing huge new debts to the courts that incarcerated them.

In many American states, ex-offenders leave prison owing fees and fines to the court - possibly $50 (£31) for police transport, or $35 (£22) to a victims' fund, or $100 (£62) for some unspecified administrative fee.

But in Philadelphia, you can also owe money for missing court dates before your imprisonment - and these sums run into thousands of dollars.

Those fines ratchet up the bill quickly, with some people who thought they'd paid for their criminal past discovering that they now owe tens of thousands of dollars.

The collections are part of a massive reform of the city's courts, led by Judge Pamela Dembe - President Judge of Philadelphia's Court of Common Pleas.

Image caption Until last year, Taylor had no idea that he owed money to the courts

"It isn't random," she says. "This is collecting money from people who have cost us, the taxpayers, a lot of money to bring them to justice."

Rufus Taylor grew up in north Philadelphia in the early 1990s, a nascent criminal who says he started committing crimes for "the rush".

First arrested for stealing cars, he was eventually locked up for helping friends with an armed robbery.

Taylor spent the next 14 years in and out of prison. He finally walked free in 2008, owing no more prison time or parole. He was done with the courts - or so he thought.

But last year, when he wasn't making enough money to support his two young daughters, he went to try and sign on for welfare and was presented, out of the blue, with a court bill for $41,897.70 (£25,767).

I don't think it makes any sense to punish somebody in 2012 for something they did in the 1990s Sharon Dietrich, Community Legal Services

"I did my time… I did everything requested," he says. "You don't let me know none of this until after I'm off parole?"

Doubtful that he owed anything at all, Taylor got in touch with Sharon Dietrich of Community Legal Services in Philadelphia. Dietrich's organization works with low-income clients, so she is used to seeing them burdened with financial debt. But she says she'd never seen anything like the flood of cases like Taylor's that has poured into her office over the last two years.

"Never. The intensity of this collection effort and the number of people that it affected drove in way more clients than I've ever seen on any one other issue."

Some people got letters, some received calls from collection agencies, some - like Taylor - were blocked from other services because they owed money to the courts.

Philadelphia didn't start attempting to collect these debts until 2010, but some of the infractions date back to the 1970s. Taylor's being asked to pay for four separate times he missed court dates back in 1994, when he was 18 years old.

Dietrich says she can't understand this. "I don't think it makes any sense to punish somebody in 2012 for something they did in the 1990s," she says.

Criminal justice debt is not like owing money to Visa or Amazon - there's no statute of limitations. It doesn't get cancelled out after 10, 20 or even 30 years and you can't free yourself from it by declaring bankruptcy.

"If Amazon.com decided that I owed them money, and they wanted to get that money from me, they would have to go to court, file a complaint and show that I owe them a debt and then I could defend myself," she says.

"But the court, being the legal process [itself], is in a position where they can force people to play the game their way."

Philadelphia is the fifth biggest city in the United States, one of those historic East Coast cities known for its "firsts" - first bank in America, first hospital, first medical school - it even claims the first zoo. But in the post-war era, it has struggled.

There was an increase in crime in the late 1960s/early 1970s and Philadelphia - along with the rest of the country - embarked on an era of "get-tough laws". That, along with the "War on Drugs", has resulted in a huge expansion of the country's prisons and its prison population.

There's no question that accused criminals were just flagrantly disregarding the rules Craig McCoy, Philadelphia Inquirer

Philadelphia Inquirer reporter Craig McCoy says that in 2006 and 2007, Philadelphia had the highest rate of violent crime - rapes, assaults, robberies - and the lowest conviction rate of America's largest cities.

The courts and law enforcement agencies had problems keeping up.

"There's no question that accused criminals were just flagrantly disregarding the rules and just 'blowing off' their obligations to be in court… they faced no consequences for it whatsoever," he says.

In a series of reports for the paper called "Justice: Delayed, Dismissed, Denied", McCoy and his colleagues revealed that in 2009 there were a staggering 47,000 "fugitives" in Philadelphia - people who were arrested, posted bail and then disappeared.

When pressed by the Philadelphia Inquirer, the Clerk of Quarter Sessions Office - an agency as antiquated as its name suggests - said they were owed a billion dollars in unpaid bail and another half billion dollars in unpaid fees, fines and victims' compensation.

Image caption Mayor Nutter says his court collection programme is not just about raising money

Just months after the Inquirer published its series, Philadelphia Mayor Michael Nutter shut down the failing agency and launched a new collection program, which they called: "Stand Up, Pay Up".

Mayor Nutter says it wasn't just about the money - it was also about changing a culture and a mindset.

"People think that this is a game. This is not a game. We are serious as a heart attack about collecting this money," he said at a press conference in 2010.

The debts are owed by over 300,000 people who have been arrested or in prison, so to Judge Dembe they're law-breaking fugitives. Others, such as the legal aid lawyers, say they're among the city's poorest and most vulnerable citizens, and that these debts are just one more burden holding them down.

Taylor says his criminal days are behind him. He has moved his family out of north Philadelphia to the sleepy area of Sharon Hill. He and his fiancée, Dawn, now have five children between them, including a new baby son. Now that he has a family to look after, he says he sees his finances differently.

"When I was in the streets, selling drugs, doing robberies, stealing cars… I didn't appreciate the money," he says.

"As soon as I got it I spent it. But now that I'm trying to support my family, I appreciate every penny."

Taylor's debt means that not only does he owe the courts money, but also it has adversely affected his credit rating, making it difficult to buy a car, get a loan or a mortgage.

A few months ago, his lawyer - Sharon Dietrich - disputed his debt to the courts, and won a partial victory. The court voided 90% of his fines for skipping court four times. That took his almost $42,000 debt down to a much more manageable $4,000.

Find out more Amanda Aroncyzk's documentary The Cost of Doing Time was broadcast on BBC World Service Listen via BBC iPlayer Browse the World Service documentary podcast archive

This happens regularly at court hearings - people are presented with enormous fines, the court reduces them significantly and sets up a monthly payment plan.

Judge Dembe says that the courts are happy to consider any "faintly reasonable" payment plan. It could be $50 a month, it could be $25. Once a monthly amount is set, it might continue for the next 20 or 30 years - almost like a lifelong subscription to the court, but without any privileges.

Taylor's lawyer thinks he shouldn't have to pay $42,000 or $4,000 or even $25 a month. She appealed directly to Judge Dembe.

Taylor's entire debt hinges on where he was in the summer of 1994. Did he skip bail four times, before getting arrested for that armed robbery? His lawyer says he couldn't have gone to those court dates, because he was already in jail.

Dietrich says that the court/prison system's record-keeping at the time was dreadful.

But Judge Dembe says there's enough documentation to prove Taylor's whereabouts, and that yes, he did miss court dates. She says she feels pretty comfortable with the original decision.

"This is clearly a guy who was well on his way to being a lifelong criminal - ducking the system at every possible opportunity," she says.

For now, Taylor is trying to find steady work to support his family - but it's not easy with a felony conviction.

At least his debt, he thinks, is something he can get lifted. Earlier this month his lawyer submitted a second challenge to Judge Dembe's decision.

Dietrich is challenging the debt collection on a number of procedural problems, including the age of the debts and what she sees as a lack of evidence in many of the cases. She filed three other appeals along with Taylor's, and expects Pennsylvania's Superior Court to hear the case in the new year.

Amanda Aroncyzk's documentary The Cost of Doing Time was broadcast on BBC World Service. Browse the World Service documentary podcast archive here.