rubyish quicksort tidy, etc