adding problem 2 solution