Problem 2 solution added.