Implement ch2.1.3's examples