sort implementations in ruby