Add quick sort.
Minor code improvements.