Improved total_count