Changed equals method in Rational class