added merge_partitions to sort.py