Adding functionalilty for reading the serial port