using rational numbers