mergesort works