begin to handle the state transfer graph problem