finish levenshtein_dist function