source: improved quicksort. Slight bug which still needs to be worke dout