edited Graph.c to be more concise