added a search type function