renamed to maxRectUnderHist