In a country in which we pride ourselves on the principle of “innocent until proven guilty” we should not be keeping hundreds of thousands of people locked up before they have actually been convicted of a crime.

And yet in 2016, more than 65 percent of the over 700,000 people in county or city jails on any given day in the United States were “unconvicted” — meaning that more than 400,000 people were in jail who had not been convicted of a crime, often because they lack the money to pay bail. In other words, we have criminalized poverty.

That is not acceptable. Pretrial detention should be not based on how much money a person has, what kind of mood the judge is in on a given day, or even what judge the case happens to come before.

When a person is arrested, they are brought before a judge to evaluate the charges against them and decide whether or not to set bail — and, if they set bail, at what amount. But bail is not supposed to be set above a person’s ability to pay; people should not be sitting in jail awaiting their trial simply because they are poor.

In 2016, the average length of stay in jail for the entire jail population was 25 days, according to the Bureau of Justice Statistics. It might not sound like much, but the sad truth is that people who can’t afford bail, and who thus spend 3 or 4 weeks in jail awaiting trial, are likely to lose their jobs and their income, they won’t be able to pay their rent and may find themselves homeless, and they may even lose custody of their children — all because they don’t have enough money to buy their way out of jail.

Further, a recent study showed that people who have to stay in jail before their trial are more likely to plead guilty — presumably just to move the process along. According to the ACLU, “pretrial detention is the greatest predictor of a conviction.”

Overall, the U.S. spends nearly $14 billion each year locking people up who haven’t been convicted and might never be. It’s clear the system is a poor use of resources. In 2015, the city of New Orleans collected $4.5 million in bail, fines and fees, but spent $6.4 million detaining people who couldn’t afford to pay their bail, fine or fee.

And, as with so many other aspects of our society, for-profit companies are make huge profits off of poor defendants. The for-profit bail industry makes well over a billion dollars each year — and the U.S. is one of only two countries in the world that even allows for-profit bond companies.

It is, quite simply, a travesty that, in the year 2018, we continue to have debtors’ prisons in the United States. We can, and must, find a better way — and there are communities from which we can learn that have already implemented alternative systems.

Pretrial detention should be not based on how much money a person has, what kind of mood the judge is in on a given day, or even what judge the case happens to come before.

More than two decades ago, Washington, D.C. created a system where very few defendants are required to post cash bail to be released — in fact, about 90 percent of defendants are released on promises and conditions other than cash, and 90 percent of those released do not reoffend before trial. No one is locked up because of inability to pay. New Jersey implemented bail reform in 2017 and after a year, the pretrial jail population had dropped 20 percent. Philadelphia is moving to abolish cash bail for certain crimes. All across the country, progressive prosecutors are taking a look at the cash bail system and seeing how it can be reformed.

Ending the current cash bail system is not only the humane and just thing to do, it also makes more fiscal sense. According to the Pretrial Justice Institute, it costs about $75 per day to hold someone in jail, but only $7 per day to supervise that person in the community. When Yamhill County, Oregon, instituted a new program to call defendants with automatic reminders about their upcoming court dates, they originally budgeted $22,500 for the first year. The program wound up averaging a cost of just $550-$600 per month, and over a three-month span, only 2.7 percent of defendants failed to appear in court.

I introduced legislation this week called the “No Money Bail Act” to abolish the use of cash bail in federal courts and to help state and local governments implement alternatives to this broken and destructive system. My bill is similar to legislation that Congressman Ted Lieu introduced in the House. If passed, either would encourage states to abolish cash bail by providing new grant funding to help them implement a fairer and smarter alternative.

On the other hand, if a state chooses not to abolish money bail, the legislation would revoke certain federal criminal justice funds the state currently receives. Lastly, the bill requires a federal study after three years to be sure the alternate systems are not perpetuating the racial and ethnic discrimination we see now with the cash bail process.

Four words are engraved on the front of the Supreme Court: “Equal Justice Under Law.” Needless to say, we are very far from that ideal today. I hope this legislation will bring us a step closer.

Bernie Sanders is the junior Senator from Vermont.