Update accumulate.cpp