[v1] Better reduce algorithm