Written and tested mergesort