Adding edit distance