first function, xbescan