Implemented grep search functionality