chapter 8 examples. this file can be executed off the command line