Trie implementation finished