update Huffman coding