added solution to hw2 problem 2g