Added Events code

Signed-off-by: Michael Greenhill <doctorjbeam@gmail.com>