refactor testBisect