Finish Problem 4. All tests pass.