Added merge functions (not completed).