implement huffman tree with ordered list