Finished search function.