add copy() for graph