Added more base for mergeGraph function