Added problem 3 solution