getting closer to a working add_ma function