Huffman encoding works