Implement ch1.1.8's sample