Implement ch3.2.2's examples