implemention of duty cycle