The base function: read and write