working on maxrects.calc