Add codes for exercise 2.5