Added some optimizations to the Partition object.
Minor modifications