working version of quick_sort_1