finished encoding with Huffman trees