Added mergeGraph method