adds rselect and quicksort sort implementations