Add GCD algorithm