Implement ch4.1.5's examples