Added memory-intensive counting