Implement ch3.4.1's examples