updated headers and serial output code