now states are both inputs and outputs