Implemented the basic system event queue