renamed gcd to cover few other fn