pwm processing - updated