Implement ch2.1.4's examples
Answer ex2.7