updated graph.c