use the format method? and write everything at once?