mergesort, selection sort complete