implement find_free_bit