Merge sort implementation in ruby