Started coding multinomial functions