Performance improvement to counting
Performance improvement to counting