reformat and add copyright