Fixed EXT_ITER bug and replaced the external iterations
Fixed EXT_ITER bug and replaced the external iterations