Binary Search - Iterative Implementation and common errors