See code in example_7.55
