code for search feature updated, review needed