I explained the sub-goals for the second problem