Adding trie implementation