minDist modification