added multinomial coefficient