add exercise 10 from ch03