Little changes to count logic