add:code from chapter 1 to 5