changed random integer to use multinomial