FIX: bit counting math