Creating a new function and passing a variable

I have the answer here.