formating the graphs for problem 4