Implemented the search