Edit distance thing sort of done, lots of debug printing