upgraded SGScript, added modifications for profiling