chapter 3 vector type class