add median_with_sort