works up to section 6