cleaned up serial code and added fifo code