minGap and maxGap