added threshold counting as a speed test