implemented serial port input