Updated example to events

Updated example to show use of examples.