Problem 3 solution added.