public?
maxX and maxY are unused