def binary_search(input_array, value):

    """ Algorithm: Here is how it could be done:
    1. Get middle index of array with range (0...array-size)
    2. Compare value of mid-element at that index with given value
        2.1 If (value == mid-element)
                then return the middle index [DONE]
        2.2 Else If (value < mid-element)
                then  repeat step 1 with range (0...mid-element-index)
        2.3 Else If (value > mid-element)
                then repeat step 2 with range (mid-element-index + 1, size)
    3. Since iteration completed without finding the elements, return -1"""

    """ Step 1"""
    start = 0
    end = len(input_array)

    """ Step 2"""
    while end > start:
        mid_index = (start + end) / 2
        mid_value = input_array[mid_index]

        if value == mid_value:
            return mid_index
        elif value < mid_value:
            end = mid_index
        else:
            start = mid_index + 1

    """ Step 3"""
    return -1