code cleaning. add 2n partitions