Trying with an alternative sorted function for quicksort