Added code for random partitioning and random overlapping