rewrite a section that repeats itself