Use state machine for behavior & fixed some networking bugs
Merge remote branch 'origin/stateMachine' into stateMachine