add a read method and write method