implemented the huffman coding