finish Huffman coding