added physical pins
PWM fixed, light rewrite, io optimizations