In recent months, the city and state of New York have moved to decriminalize prostitution. State lawmakers repealed a law that made “loitering” to sell sex a crime. District attorneys in Manhattan, Brooklyn and Queens announced that while they would continue to prosecute pimps, sex traffickers and “johns” who pay for sex, they would be referring men and women involved in prostitution to social service agencies. The DAs dropped thousands of cases of unlicensed massage, prostitution and loitering dating back to the 1980s.

The changes came after a ProPublica series on prostitution arrests in New York City that began with a basic question: What are the costs (or possible benefits) to society of sending police officers out to arrest people for prostitution? As with many investigative stories, this one began with a specific tip about an undercover cop who was purportedly entrapping women and a few men into offering to sell sex. We didn’t know his name, just that he was referred to in court proceedings as Undercover 157. (In a statement, the NYPD defended the undercover officer as a veteran “with approximately 1,800 successful buys and no complaints against him at the NYPD or with the Civilian Complaint Review Board,” later clarifying this meant no active complaints.)

ProPublica doesn’t have the time or resources to follow up on every allegation of a single potentially rogue cop. But reporter Joaquin Sapien and editor Alexandra Zayas had a gut feeling that they were looking at something larger. A few years earlier, multiple present and former members of the New York Police Department’s vice unit had been convicted of running a brothel, a hint that oversight might be lacking.

We dug into the NYPD’s procedures for policing prostitution in the 21st century and learned more worrisome details. In an era of body cameras and miniaturized recording devices, the cops were not routinely recording the verbal exchanges that led to arrests; the evidence that someone had offered to do something illegal was relayed by the undercover cop to a nearby backup team via radio. Few of the cases ever came to trial. New York created a system in which people accused of prostitution could be diverted to classes intended to help them leave “the life.” If they missed any classes or failed to appear in court to show their attendance, a warrant could be issued for their arrest.

Several things caught Joaquin’s and Alex’s attention about this arrangement. The cops often earned overtime for making these arrests, giving them a financial incentive to arrest as many people as possible. And there was no real check on the conduct of the officers. In those rare cases when defense attorneys challenged the arrest, cases were often dropped, keeping the undercover cop’s identity and tactics secret. If a police officer were less than ethical, he or she would have every opportunity to earn a lot of money by stretching the truth.

Joaquin was joined on the project by Joshua Kaplan, a ProPublica senior reporting fellow with a background in statistics. Josh combed through the arrest records of the people in New York City charged with prostitution and came up with two stunning numbers: 89% of the 1,800 people accused of prostitution in the last four years were nonwhite, as were 93% of the 3,000 “johns” charged with trying to buy sex.

“Of the dozens of cops, lawyers and other experts ProPublica interviewed,” Josh and Joaquin wrote in their first story, “not a single one believes arrest figures for patronizing a prostitute accurately reflect the racial makeup of those who buy sex in New York City.”

“I know for a fact that white men are the key demographic,” Meredith Dank, a research professor at John Jay College of Criminal Justice, told the reporters. Dank and her colleagues have interviewed more than 600 young people who trade sex in the city. In one of their studies, 65% said their main clients are white.

The punishment for the crime of prostitution was being disproportionately paid by New York’s Black and brown citizens, many of whom lived in the city’s poorer neighborhoods.

To my mind, this is the best of what investigative reporting can do. It takes government policies that have gone on for decades, if not centuries, and examines their potential benefits against their measurable costs. In this instance, law enforcement officials defended the policing of prostitution as a response to community complaints. In some instances, they said, the arrests could save women who had been trafficked into selling their bodies. Experienced officers told Joaquin and Josh that investigations of sex trafficking operations were far more complex than charging an individual with prostitution and took time and resources the department seldom provided.

Our reporters found that many people they interviewed who were doing sex work had not been forced into it by some viscious pimp or human trafficker. Most were doing what they could in desperate circumstances to feed their families and avoid homelessness. The city’s preferred solution, counseling sessions on the risks of selling sex, did little to address their real problems.

All in all, the use of tax dollars to pay cops to make low-level prostitution arrests was an utter waste. “The guys who are doing the work, who had been in vice for years and years, all said the same thing,” Joaquin recalled. “This doesn’t make a damn bit of difference in the amount of sex being bought and sold in this city.”

Over the years, we’ve undertaken similar investigations of well-established police procedures that had long ago outlived their usefulness. In 2016, we worked with Sarah Ryley, a reporter at the Daily News, to investigate a program that allowed the NYPD to kick people out of their homes if they were creating a “nuisance.” Her reporting showed that the evidence was often flimsy and the bulk of the cases, once again, involved Black and brown New Yorkers. The stories won the 2017 Pulitzer Prize for public service and New York’s City Council essentially banned the practice, which dated to a period of history when crime rates were much higher.

Alex, the editor of the prostitution stories, had worked on a series in 2015 for the Tampa Bay Times about the propensity of Tampa police to cite certain bicyclists for trivial infractions like failing to keep both hands on the handlebars. It turned out 8 of every 10 tickets were issued to Black riders. The crime was known as “biking while Black.” A few years later, ProPublica’s Topher Sanders partnered with The Florida Times-Union on how Jacksonville police enforced the laws that bar pedestrians from wrongdoing like jaywalking. That series, “Walking While Black,” found that not only were local police disproportionately ticketing Black people, some of the tickets weren’t even valid.

In recent weeks, I’ve begun to wonder about another long-accepted aspect of our culture: traffic stops. Seemingly every morning, I flip on my phone to read another story of a motorist, usually a Black person, shot and killed after being pulled over. In April in Brooklyn Center, Minnesota, 20-year-old Daunte Wright was shot and killed by an officer who police say accidentally fired her gun instead of a Taser. The stop was clearly pretextual: Wright had air fresheners hanging from his rearview mirror, grounds for a traffic stop because his view of the road was obstructed. Then the police found he had an expired registration and an arrest warrant. The situation became volatile, and in a few moments, Wright was dead. Minnesota is one of several states that have laws relating to rearview mirrors. Last year, Virginia’s General Assembly voted to bar police from pulling over drivers for a wide array of minor offenses, including missing brake lights, overly tinted windows, noisy exhaust systems, the smell of marijuana and “certain objects suspended in the vehicle.”

A lot of laws and police practices American society took for granted have fallen by the wayside. The sort of police raids on gay bars that led to the Stonewall uprising in 1969 became unimaginable decades ago. State by state, the laws against drug possession are being repealed. A judge ordered New York City to end stop-and-frisk policies, the random searches aimed at young men of color.

As readers of this column know, I’m a firm believer in the notion that journalists are lousy at guessing what will happen in the future. But here’s a prediction from this journalist: A decade from now, stop-and-frisk of the highways will be a thing of the past.