update code for chapter-07