fix Levenshtein edit distance implementation

closes #252