exercise 2.57 (with simplifications!)