made count_results python 3 friendly