added better error checking to xLambda