A simple bisection script