reading/writing and serial implementation