Create searchfunction