Updated edit distance