Second exercise: event emitter