Updated calculatePartition procedure.