answers for Chapter 4 on Higher-Order Functions