Implement ch2.2.3's examples