reformatted code.
added files for chapter 3