Update edit distance