trie class implemented