add Huffman encoding procedure