completed recursive GCD program for algo