public int getMaxSum() {
		maxSum = Integer.MIN_VALUE;

		for (int rowStart = 0; rowStart < width; rowStart++) {
			for (int colStart = 0; colStart < width; colStart++) {
				for (int rowEnd = 0; rowEnd < width; rowEnd++) {
					for (int colEnd = 0; colEnd < width; colEnd++) {

						int sum = 0;
						for (int row = rowStart; row <= rowEnd; row++) {
							for (int col = colStart; col <= colEnd; col++) {
								sum += matrix[row][col];
							}
						}
						if (sum > maxSum) {
							maxSum = sum;

						}
					}
				}
			}
		}
		return maxSum;
	}