levenshtein implemented with dynamic programming.