Event Loop - Solution