reformat sample code