avoid sort_by, not in ruby 1.8