updated write() attribute order