Modulus to function before summation to running total