while(i > 0) {
while(i >= 0) {
    private int reduceParameters(boolean normal) {	int i = states-1;	int j = states+inputs-1;	int r;	boolean found;	int max_index; double max_val, temp_val;	double temp, val, curr;	ComplexNumber tempComplex;	while(i > 0) {	    	    found = false;	    while((j>i)&&(!found)) {		int k=i;		while((k >= 0)&&(!found)) {		    if(!totalMatrix.getElement(k,j).equals(ComplexNumber.ZERO))			found = true;		    k--;		}		if(!found)		    j = j-1;	    }	    if(i == j)		break;	    LinearPrinter.println("hello " + totalMatrix.getElement(i,j));	    //partial pivoting	    max_index = i;	    max_val = Math.abs(totalMatrix.getElement(i,j).getReal());	    for(int l=0; l<i; l++) {		temp_val = Math.abs(totalMatrix.getElement(l,j).getReal());		if(temp_val > max_val) {		    max_val = temp_val;		    max_index=l;		}	    }	    swap(max_index,i);	    curr = totalMatrix.getElement(i,j).getReal();	    	    LinearPrinter.println("i,j,curr " + i + " " + j + " " + curr);	    if(!totalMatrix.getElement(i,j).equals(ComplexNumber.ZERO)) {		//scale(i,1/curr);		for(int k=0; k<i; k++) {		    tempComplex = totalMatrix.getElement(k,j);		    if((!tempComplex.equals(ComplexNumber.ZERO))) {			// do NOT do row operations with values too close to MAX_PRECISION			// therefore, we will use MAX_PRECISION_BUFFER, which is greater			    			if(Math.abs(tempComplex.getReal()) > ComplexNumber.MAX_PRECISION_BUFFER) {						    temp = tempComplex.getReal();			    val = -temp/curr;			    addMultiple(i,k,val,normal);		       			    // set the value to be exactly zero (in case it is very small but non-zero)			    totalMatrix.setElement(k,j,ComplexNumber.ZERO);			}		    }	    		}	    }	    i = i - 1; 	    j = j - 1; 	}	if(i == j)	    return i;	else	    return -1;    }