modified  edit distance file