exercise2.13 solution