added free_bit_array function