Working through chapter 3 of Javascript TGP