added GCD code