Start of search function