A handful of sorting functions in Ruby