binary searches, and cipher