Using lambda to catch needed variables.