write and read works