More code and fixes, also a quicksort variant