make 71 even more effective by only computing gcd at the end