Finished search funtion