Problem 39 complete