move writeToFile changes into separate branch. i'll introduce incompatibility later