Implemented an event queue