fixed mergesort