Moved StateCounts which is an implementation helper class to engine.dart