Problem 18 complete