added filtering by distance