At a range parameter in the get_distance function that limits the distance calculated between each pair of points to this range. For instance set the range to 1000 m and the function only retrieves pair of points that are within this range of 1000 m and is not returning all distances between points.