almost done subproblem 1