prepares levenshtein distance solution