exercise 2.31 tree-map