improved trie tree