revised both binary searches