added a solution for prob2