simple scala rationals implementation