for chapter 3 of tutorial