private int[][] addMatrix(final int[][] X, final int[][] Y) {
        try {
            int[][] addition = new int[X.length][X[0].length];
            if (X.length == Y.length) {
                for (int i = 0; i < X.length; ++i) {
                    if (X[i].length == Y[i].length) {
                        for (int j = 0; j < X[i].length; ++j) {
                            addition[i][j] = X[i][j] + Y[i][j];
                        }
                    } else {
                        System.out.println("Input matrix must have equal length of column");
                        return null;
                    }
                }

                return addition;
            } else {
                System.out.println("Input matrix must have equal length of row");
            }
        } catch (NullPointerException e) {
            e.printStackTrace();


        }
        return null;
    }