major updates to count.py