Adapt some magic to SG