Update editDistance