Implement ch3.2.4's examples