Foobar Optimization
Binary search iterative version