solution for Problem set 2 problem 2