function to check if user-function returns all variables declared earlier