reimplement levenshtein as a fallback