optimize repetition loop
do not loop past the last irreversible move.