completes chapter 5 minus a couple exercises