added edit distance