added primative state machine structure