merge sort on the list of elements