added solution for hw2 problem 2c