levenshteinDistance logic version