Streamlining and commenting of the MMSE functions