added some define partitions logic