Huffman encoding works now