update second trial of edit distance