Updated levenshtein match implementation