problem 40 complete