public int[][] naiveMultiplication(final int[][] X, final int[][] Y) {
        try {
            int[][] result = new int[X.length][Y[0].length];

            // for each rwo of X
            for (int i = 0; i < X.length; ++i) {
                if (X[i].length == Y.length) {
                    // for each column of Y
                    for (int j = 0; j < Y[i].length; ++j) {
                        // multiply each element and sum together
                        for (int idx = 0; idx < Y.length; ++idx)
                            result[i][j] += X[i][idx] * Y[idx][j];

                    }
                } else {
                    System.out.println("X's column length must be the same with Y's row length!");
                }
            }

            return result;
        } catch (NullPointerException e) {
            e.printStackTrace();

            return null;
        }
    }