improved get_IDs