Implement ch2.2.1's examples