added serial code