added solution for hw2 problem 1c