co fix, check for undefined after gcd