result is sorted by distance