solution for prob2 completed