Minor code refactor, PWM tested on hardware and confirmed working