Implement ch2.4.1's examples