added simpler version of pwm controller