Finalized the second problem.