adding edit distance