consolidated two loops in sync_get_state()