Implemented a merge sorter.