Adding problem 2 solutions