Implemented an event system