fixed up the merge code to be much more advanced and focussed on the data being dealt with by roar