Potential state machine