added overloaded function for merging that accepts an idlist and additional datatype to support scripting