answer for exercise 3.4 added