added the search function