Rework

removed all pwm stuff and enhanced code quality