added second loop to brent run