add edit distance method