finish codes of chapter 4
start code in chapter 5