Implemented quicksort