Finished quicksort thanks to google and @Sammons