Fixed flaw in countConsecutive in logic