add debug code
internal_id_map
ReafFunction::write_index