modify dataset_count to be more pythonic