created trie functions: insert and search