frequently using code for accumulation