3rd version of quick sort