reformat wgml research code