Insertion sort in ruby