updated SGScript and makefile