problem 2.38: complete (tentatively at least)