Stripped main of old work. Updated to use two channels for PWM.