Added Partition function