Use simple way to count bits, without using yield