In my c++ implementation of Huffman encoding and decoding, I keep receiving weird output when attempting to decode and output the result. For example, given the input: