Added Exercise 1.16, 1.17 and 1.18.
Added tests for all of them.
Corrections and improvements in the comments.