public int maxArea(int[][] newMatrix, int lx, int ly) {
		if (lx < 0 || lx > newMatrix.length || ly < 0
				|| ly > newMatrix[0].length) {
			return -1;
		}
		int m = newMatrix.length;// length
		int area = 0;
		int rx = lx;
		int ry = ly + newMatrix[rx][ly] - 1;
		while (rx < m - 1 && newMatrix[rx][ly] >= 1) {// go down until we reach
														// the second last one
														// or we meet a '0'
			area = Math.max(area, (ry - ly + 1) * (rx - lx + 1));
			rx++;// update rx
			ry = Math.min(ry, ly + newMatrix[rx][ly] - 1);//update ry
		}
		if (newMatrix[rx][ly] >= 1)// update the last one if necessary
			area = Math.max(area, (ry - ly + 1) * (rx - lx + 1));

		return area;
	}