finished section 3.4 and 3.5