Implement ch3.5.5's examples