main tutorial, starting from chapter 3