Added game loop logic in comments