compute cmax every time step.