beginning of PWM stuff