aligned the source code with the chapter 5