fixing mad analysis