Additional method for mahalanobis distance calculation