make the lambda functions actually do the correct thing