impl Huffman code