finished the search functions