GCD implemented as described in derp