anchor.diff:                 END DO
                  PREVTIME = TIME
                  go to 1
  -            END IF
  +	    END IF
   	 !impspecies>0: corresponds to conversion goal; this block differs from above block only in the extra criterion Y(IMPSPECIES) .GE. TARGETCONC(K)*Y(NSTATE)
  -	 ELSE
  -   1       IF (Time .LE. TSTEPS(K) .AND. Y(IMPSPECIES) .GE. TARGETCONC(K) &
  +	ELSE
  +   2       IF (Time .LE. TSTEPS(K) .AND. Y(IMPSPECIES) .GE. TARGETCONC(K) &
        &        *Y(NSTATE)) THEN
               CALL DDASPK(RES, NEQ, Time, Y, YPRIME, Tout,INFO, RTOL, &
        &           Atol, IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC, &
  
positive.code:          call reaction_flux(y, prevreactionflux, rpar)
  
           !impspecies=-1, corresponds to time goal, rather than conversion goal
  	 IF (IMPSPECIES .EQ. -1) THEN
   1        IF (Time .LE. TSTEPS(K)) THEN
              CALL DDASPK(RES, NEQ, Time, Y, YPRIME, Tout,INFO, RTOL, &
       &           Atol, IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC, &
  
negative.code:                   PREVREACTIONFLUX(I) = CURRENTREACTIONFLUX(I)
                 END DO
                 PREVTIME = TIME
                 go to 2
  		END IF
  	    END IF
  	END IF
           
           WRITE(*,*) "STEP: ", K, " OF ", NUMITER," DONE"
           WRITE(15,*) (NSTATE-1)*(nparam+1)      
  