final result_set is created in sorted order of distance