wrote minDist for Bourgain