renamed M to a
renamed M to a and fixed doc string
fixed application of imperfections for many models simultaneously
changed variable names