fixed multinomial sampling.