A simple algorithm could help clear thousands of cannabis convictions