refactored hard_counters.py to be run from outside of Python environment