implementation the trie tree structure