fix lambdas so that they can return other lambdas