finishing chapter 4 plus minor changes