Add count_occ and id_to_levels