added some basic PWM for speed control