added tests for the state machine