counting pulses: