Added merge routine