modify logic of judgement using gcd