Implement ch2.1.1's examples
Answer ex2.1