sorts and select, look into issue of quicksort modifying slice