sherlockGCD modified