Final version with two timers and logarithm regulator