PWM settings; removed some old commented code
Optimized phase switching