improvements on chapter 2