Basic version of quicksort