mahalanobis done

should be mostly finished