merging different partitions