More exercises from Chapter 3, revisited by introducing class Cons.