solution to prob 17