added chapter 4 egs