finished chapter 19 examples
chapter 19 bonus, created own function