chapter 41 example
added some functions to classes