Changed led pwm routine, hopefully it works