added a search function