MMA functions and tests