Demonstration of lambda function and global variables