functions for MMA

These R functions were made by GL, TI