impl simple huffman tree