merged condition, loop logic. added tests/gcd.pear