Huffman algorithm now working and correctly producing codes.