pwm handling (doesn't work yet)