Implement ch2.5.1's examples