First implementation of quicksort