Exercises 18 to 21

Also small correction to exercise 17 and some additions to .gitignore.