finished section 1 from chapter 2