Graph Function

Code for the graph function for question 6.