Search criteria dynamically #4

changed to dynamically specify the search criteria.