Revert "Optimized binary search"

This reverts commit 286861ecaa853af9a02d15807a4d6de8f04665cb.