Works with HuffmanTree