reformat and improve write.ggo