Merge routine for multiple lists