Complete exercise 2 from higher-order functions chapter.