Rewrite rational.cpp