adds new units and updates existing units