added sorting by closeness