Fixed some functions

Trying new approach to MM