Added Exercise 17.4
Added Exercise 17.5
Refactored to facilitate testing