chapter 9 -- collision detection