Huffman encoding working