Implementation of Levenshtein Distance