working on the search function