merge functions