Rename mg variable to match