Implement ch2.3.2's examples