changed getAllUnits() to return UnitList