My code for the bisection method