addIDs function