added trie implementation.