Rewrote the event system