swapped min for max in edit comparison