added a new example

demonstrating passing and using the grid object in nested functions