Los Angeles moved this week to dismiss nearly 66,000 marijuana convictions, years after the state voted to legalize the drug.

The county is working with a not-for-profit technology organization, Code for America, to use algorithms to identify eligible cases within decades-old court documents.

“The dismissal of tens of thousands of old cannabis-related convictions in Los Angeles county will bring much-needed relief to communities of color that disproportionately suffered the unjust consequences of our nation’s drug laws,” said Jackie Lacey, the LA district attorney, in a statement on Thursday.

Prosecutors this week asked a superior court judge to dismiss 62,000 felony cannabis convictions for cases that date back to 1961. The district attorney’s office also sought the dismissal of approximately 4,000 misdemeanor cannabis possession cases.

Of those getting relief under the plan, approximately 45% are Latino, 32% are African American, 20% are white, and 3% are other or unknown, officials said.

California voters approved eliminating some pot-related crimes and wiping out past criminal convictions or reducing felonies to misdemeanors when they legalized marijuana in 2016.

But there was no easy way to identify an estimated 200,000 cases statewide. Convicts had to file petitions on their own to get their records changed or hire lawyers for help with the process.

Code for America has offered its Clear My Record technology free to all 58 state district attorneys.

With the latest action, Code for America will have helped dismiss more than 85,000 marijuana convictions in five counties including LA, San Francisco, Sacramento, San Joaquin and Contra Costa, officials said.

“This is a clear demonstration that automatic record clearance is possible at scale and can help to right the wrongs of the failed war on drugs,” said Evonne Silva, Code for America’s senior program director of criminal justice, in a statement.

The computer program not only identifies eligible cases, but automatically fills out forms to file with the courts. It can analyze conviction eligibility for about 10,000 people a minute, instead of requiring county employees to dig through individual records.

District attorneys have until July to decide whether to dismiss sentences or fight reducing the convictions.

Prosecutors in Baltimore, Seattle, Chicago and other cities have said they also would clear eligible marijuana convictions.