cleanup and comment chapter 7