autocompletion using trie