Added discr function