updated merge sort with ruby solution