Updated discriminant analysis code