Fixed bug with count modifying state; added bit sieve for faster counting