better documentation for partition function