initial SortMerge code; not working yet