filter by distance after sorting