search function prototype