finished chapter 4 - templates