Fixed the game loop (Quite hackish now)