implemented SEARCH functionality