fixing multinomialize script