Implement ch4.1.6's examples