Updated example, added globals