initial implementation of updated (see repository with gcd) gcd