Fixed C++ huffman encode program