public Matrix subtract(Matrix a) {
        if (a == null) {
            return null;
        }
        if ((!this.isJagged && !a.isJagged) && this.sameOrder(a)) {

            double[][] new_elements = new double[this.rowCount][this.columnCount];

            for (int row = 0; row < this.rowCount; row++) {
                for (int column = 0; column < this.columnCount; column++) {
                    new_elements[row][column] = this.elements[row][column] - a.elements[row][column];
                }
            }
            return new Matrix(new_elements);
        }
        return null;
    }