private void step(int k, int m){//elements[k][m] must be nonzero
    //rationalizes below k row, makes zeros in the m column
        int i;int j;
        double s;
        if ((k+1)!=rows){
            for (i=k+1;i<rows;i++){
                s=elements[i][m]/elements[k][m];
                for (j=m;j<columns;j++){
                    elements[i][j]-=s*elements[k][j];
                }
            }

        }
    }