discriminant function added