Grouping steps by similar mismatches