Trying to implement quicksort