Problem 18 completed