added merge sort to the code