solution for Problem Set 2 problem 2