Implement mergeSort