updated sample code & sgscript