Implemented Rational class