improved counter for bubble_sort.py