Implemented mergeSort