adding make mem for generating