ported backward accumulate process