Added sum' and length' from Example 1.12.