insert method for search trie