Write utilities to answer Exercise 2.84