add mahalanobis calculations