update bisection method and add function to it