updated docs with write()