loop to conditional cycle