changing example to reflect a future idea of API to support user-defined events