BIGFIX: changed GCD to use absolute values of input