Refined merge heuristic