Added sub-goals for the third problem.