finished chapter 2 of tutorial