merge sort implementation.