totally refactor all the PWM stuff