merge sort implemented