added solution to prob 5