Merge sort is a little strange but works.