Added generateM.