added test values, implement gcd with logarithmic run time