def execute(data):
    """ Execute boot instructions until stop condition is met.
    """
    # process the instructions until we hit a duplicate
    acc = 0
    i = 0
    executed = set()
    while i not in executed:
        # add this instruction to the list
        executed.add(i)

        # process it
        instruction, val = data[i]
        if instruction == "nop":
            # null operation, pass
            i += 1
        elif instruction == "acc":
            # accumulate value
            acc += int(val)
            i += 1
        elif instruction == "jmp":
            # jump to new line
            i += int(val)

        # check for success (non-infinite loop)
        if i == len(data):
            return (True, acc)
    return (False, acc)