Added edit_distance option