building the huffman tree