GameState loop updated for AI mode, added comments