Huffman coding algorithm fixed