Use the library bitcounter.
Use full values instead of counting bits. The memory savings aren't worth it.
Fix undo