more work on merging graphs