Replaced redundant counts in the DB with one loop for counting them all