added solution to prob 2