finished chapter 3 of the tutorial