revert chapter 1 code