Optimum merging -- lots of incremental optimizations

This is roughly the halfway point.