Added Partition class and locking methods