remove unused import
use fractions.gcd instead of local implementation