added state machine but kept booleans for now for AI