Adding Accumulate variant of previous program