Implement ch3.3.2's examples