new version of main that updates CPs alive status in state