brent method moved to a new file