multiway mergesort works