function numberUnitsAtPosition