convert from print to write, pre-beta version