compute iteration state