Implemented a merge sort