Initial code for search function.