Generic Merge sort