updated multinomial, fixes #499