Rewriting SMG