Adding some comments to the write function.