completed state transition function