use lambdas so i can use the local scope