updated edit distance stuff