Re-implement GCD iteratively. Fix unused function warning.