updated sgscript, +refactor