Changed duty cycle algorithm.