changed to use Rational number (and became much slower...)