Added Brent pseudocode