I know that when you write a lambda you have to capture the outside variables to make them available inside the lambda. But what about functions? Do functions have access only to GLOBAL variables? I have doubts regarding this because of how the following code works.