Implement ch2.3.1's examples