count votes function removed
run_ai moved to inside cmbe
state change put in