refactored multinomial calcs