code for exercise 4.10