Reordered reduce arguments to better match STL algorithms.