public void execute() {
        if (pins[3].value && !lastClock) {
            if (pins[0].value) //if T = 1
            {
                pins[1].value = !last_val;
                pins[2].value = !pins[1].value;
                last_val = !last_val;
            }
	    	//else no change

        }
        if (hasSet() && pins[5].value) {
            pins[1].value = true;
            pins[2].value = false;
        }
        if (hasReset() && pins[4].value) {
            pins[1].value = false;
            pins[2].value = true;
        }
        lastClock = pins[3].value;
    }