Add the edit distance function.