fixed chapter 4 bug and clear code