Wrong M-stat

Edit the code to calculate wrong M-stat