A nicer merge algorithm