complete the merge and cleanup process