Bisection Method partial code