finished Section 1.5.4, and solve exercise_1.12.