def go_around(index, size, negative=False):
    """
    Correct index to infinitely go around an array. This is equivalent
    to carrected_index = (index % size) but this function offers more
    control.

    :param index: index to correct
    :param size: size of array
    :param negative: True to not correct negative indexes
    :return: (flag, carrected_index) flag indicating that index was corrected
    """
    if not negative or index > size - 1 or index + size < 0:
        new_index = index % size
    else:
        new_index = index
    if index != new_index:
        return True, new_index
    return False, new_index
