changed functions in huffman code