change HUFFBITS to uint16_t