Removing upper bound (max_distance) for testing purposes.