port to C-based bitarray