Added Event Handling to Game Loop