correcting Written global partition function