complete Problem 40