added new edit distance algorithm