Update sgs.lua