Update the merging algorithm.