RandomContraction: refactored condition of iteration