changed to write and removed whitespace