added PWM code