Completed Problem 40