can write to file (i think, cannot test properly)