wrote the code for the contour in problem 2