Completes problem 2.