the partition function is correct