working on Battle state machine