renamed maxX and maxY