implemented levenshtein distance in scan