public double[] solve(double[] rowValues){ // FIGURE OUT HTF THIS WORKS
        double A[][] = this.clone().elements;
        double[] values = new double[this.rowCount];
        int N = rowValues.length;
        for (int k=0; k<N; k++){
            int max = k;
            for (int i = k+1; i<N;i++){
                if (Math.abs(A[i][k])>Math.abs(A[max][k])){
                    max = i;
                }
            }
            swapRows(A, max, k);
            swapVals(values, max, k);
            for (int i = k+1; i<N; i++){
                double factor = A[i][k]/A[k][k];
                values[i] -= factor*values[k];
                for (int j=k; j<N; j++){
                    A[i][j] -= factor*A[k][j];
                }
            }
        }
        Matrix temp = new Matrix(A);
        System.out.println(A);
        return values;
    }