Added the serial port code, i'm not so sure about the com1 path, needs review