max iteraion limit added to BrentRootFinder