added my own mahalanobis implementation