implemented PWM class