added the serial port listening code and using trackrecord