set up MAD method for outlier detection. not fully tested