removed sqrt in mahalanobis distance to avoid imaginary numbers
extra warning