assigns id's to entities