mg generation