rework of chapter 5