Chapter 5. A library of miscellaneous helper functions