anchor.diff:  	!this variable will track the maxiumum
   	!of rate(i)/Rchar for each edge species i, with respect to time
   	MAXRATIO = 0
  +	!initialize HIGHESTRATIO to 0; this variable (a scalar)
  +	!tracks the maximum of maxratio; when a new maximum is
  +	!attained, the present time step creating the new maximum
  +	!will be stored for output from the ODE solver to the Java code
  +	HIGHESTRATIO = 0
   	IF (AUTOFLAG.eq.1) THEN
   		CALL EDGEFLUX(EDGEFLAG, Y, YPRIME,THRESH,ESPECIES, &
        &     EREACTIONSIZE,NEREAC,NEPROD,IDEREAC,IDEPROD,KVEC, &
        &     MAXRATIO, NSTATE)
  +		!update HIGHESTRATIO and store relevant variables that will be printed
  +		!later; note that we cannot exit the do loop once the IF statement is
  +		!caught because, even though output variables will be stored properly,
  +		!the HIGHESTRATIO will not necessarily have the highest value
  +		!note: TOTALREACTIONFLUX apparently tracks integrated flux, not
  +		!instantaneous flux, so setting value to be zero here should be OK...
  +		!in any case, the result doesn't seem to be used by the Java code
  +		DO I=1, EDGESPECIES
  +		    IF (MAXRATIO(I) .GT. HIGHESTRATIO) THEN
  +			HIGHESTRATIO = MAXRATIO(I)
  +			ITER_OUTPT=0
  +			TIME_OUTPT=TIME
  +			Y_OUTPT = Y
  +			YPRIME_OUTPT = YPRIME
  +			IWORK_OUTPT = IWORK
  +			RWORK_OUTPT = RWORK
  +			TOTALREACTIONFLUX_OUTPT = 0
  +		    END IF
  +		END DO
   	ENDIF
  +
  +
   
         iter = 0;
         PREVTIME = TIME
  
positive.code: 			CALL EDGEFLUX(EDGEFLAG, Y, YPRIME,THRESH,ESPECIES, &
      		 &     EREACTIONSIZE,NEREAC,NEPROD,IDEREAC,IDEPROD,KVEC, &
  		 &     MAXRATIO, NSTATE)
  		ENDIF
              GO TO 1
           END IF
  
negative.code:       !write(*,*) 'Time-stepping timing: ', (finishT-startT)
       ! write(*,*) (finishT-startT)
  
        !if we are not using AUTOFLAG, we just want to output the final times
        IF (AUTOFLAG .NE. 1) THEN
  	ITER_OUTPT=ITER
  	TIME_OUTPT=TIME
  	Y_OUTPT = Y
  	YPRIME_OUTPT = YPRIME
  	IWORK_OUTPT = IWORK
  	RWORK_OUTPT = RWORK
        END IF
  
        OPEN(UNIT=16, FILE='SolverOutput.dat')
  
        write(16,*) ITER_OUTPT
        WRITE(16,*) NSTATE-1
        write(16,*) TIME_OUTPT
        DO I=1,NSTATE-1
           WRITE(16,*) Y_OUTPT(I)/Y_OUTPT(NSTATE)
        END DO
        
  
  