partially working binary searches with bugs