modified fsa.py to obtain the right current state and sensor state (instead of next state and sensor state