Accumulating a value over time in magma