merge_sort from wikipedia