solution for prob 1