Wrote and fixed quicksort