cwrap for multinomial