correcting written global partition function