modify the serial code