added problem 3 solution