Solution to prob 1