Fix discriminant
Add docstring