Edited StateMachine - handles only movement now