Added pwm control