Jaquan Lugo stood stone-faced and somber inside a circular, wood-paneled courtroom on a Thursday afternoon in Paterson, New Jersey, as Superior Court Judge Donna Gallucio considered her options.

Just four days prior, the 22-year-old and two other men were arrested in Paterson, accused of six counts of attempted murder and various gun charges after a predawn drive-by shooting left a 17-year-old girl with a life-threatening wound near her lung. An off-duty officer heard the shots just a few blocks away and gave chase to the fleeing vehicle, a 2002 Jaguar, as someone inside the car fired back at him. Lugo and two of the car’s other occupants—Kashief Davis, 24, and Andre Green, 20—allegedly got out of the car and tried to escape on foot before they were caught and brought to Passaic County Jail.

The victim’s friends and family crowded into the courtroom benches to hear the decision on Lugo’s fate, but Judge Gallucio wasn’t there to determine his ultimate sentence. She was, instead, deciding whether Lugo should spend the months leading up to his trial in the county jail or at home.

Standing shoulder-to-shoulder with his client, Lugo’s lawyer, Gregory Aprile, argued for pretrial release, imploring Gallucio to consider one crucial factor: A new algorithmic tool that purports to predict a defendant's likelihood to reoffend, or to fail to appear in court, ranked Lugo as fairly low-risk. On an escalating scale of 1 to 6, it rated Lugo a 2 for failure to reappear and a 3 for likelihood of reoffending.

“They aren’t arbitrary numbers,” Lugo's attorney said of the so-called Public Safety Assessment, or PSA. “It was the result of millions of statistics from around the country.”

This may seem like an unusually technocratic approach to public defense. But it’s not so unusual anymore, at least not in New Jersey, where the state has recently undergone a holistic technological transformation of its arcane court system, all in the service of eliminating the use of bail statewide.

New Jersey is far from the only state government taking a critical look at the centuries-old bail system in America. Politicians on both sides of the aisle, from California senator Kamala Harris to Kentucky senator Rand Paul, argue that bail sets up a two-tiered justice system, in which the wealthy can buy their way to freedom while the poor remain locked up until their day in court comes. In 2016, the Department of Justice, under President Obama, also issued a Dear Colleague letter to state and local courts around the country, advising them that courts “must not employ bail or bond practices that cause indigent defendants to remain incarcerated solely because they cannot afford to pay for their release.”

As it turned out, that described a large percentage of people who have spent time in New Jersey jails, according to one 2013 study by the New Jersey Drug Policy Alliance. The advocacy group found that some 75 percent of New Jersey’s jail population at any given moment was simply awaiting trial, and 40 percent of jailed people were there because they couldn’t afford $2,500 or less in bail. On average, people spent 10 months in jail before even getting to trial. Meanwhile, because New Jersey prohibited even the most violent criminals from being detained without bail, judges often had to set exorbitant bail amounts to keep violent offenders off the streets; sometimes, those people made bail anyway.

“You had a situation where if you had money in New Jersey, no matter how serious your offense was, you could pay and walk away pending trial,” says Roseanne Scotti, the Drug Policy Alliance’s senior director in New Jersey. “If you didn’t have money, no matter how minor your offense was, you sat in jail for months.”