pset2 complete, added bisection search fn