Working on the graph functions in exercise 2.