Reworked iteration algorithm