 		
 		var i:int;
         var j:int;
-        var k:int;
-        var l:int;
-		var locale:String;
 		
 		var locales:Array = trimAndNormalize(appLocales);
 		var preferenceLocales:Array	= trimAndNormalize(systemPreferences);
 		
 		addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
 		
+		var noLocales:int = locales.length;
+		var noPreferenceLocales:int = preferenceLocales.length;
+		
 		// For better performance, save the locales in a lookup table.
-		for (j = 0; j < locales.length; j++)
+		for (j = 0; j < noLocales; j++)
         {
 			hasLocale[locales[j]] = j;
 		}

	//  Methods
	//
	//--------------------------------------------------------------------------

	/**
     *  @private

			}
			
			// Parse it again.
			plocale = preferenceLocalesID[i].clone();
			
            // Step 3: Promote the order of siblings from preferenceLocales.
			for (j = 0; j < noPreferenceLocales; j++)
            {
				if (plocale.isSiblingOf(preferenceLocalesID[j]))
					promote(preferenceLocales[j]);
			}
            				
			// Step 4: Promote all remaining siblings
            // (aka not in preferenceLocales)
			// eg. push en_UK after en_US and en if the user
            // doesn't have en_UK in the preference list
			for (j = 0; j < noLocales; j++)
            {
				if (plocale.isSiblingOf(localesID[j]))
					promote(locales[j]);
			}
		}
		
