loop reduce