 				_debugCompareCount = 0;
 				if (compare === null)
 					array1.sort(0);
+				else if (compare is Function)
+					array1.sort(_debugCompareCounter);
 				else
-					array1.sort(_debugCompareCounter);
+					array1.sort(compare);
 				trace('Array.sort', array1.length, 'numbers;', (getTimer() - start) / 1000, 'seconds;', _debugCompareCount ? (_debugCompareCount+' comparisons') : '');
 				
 				start = getTimer();

				_debugCompareCount = 0;
				if (compare === null)
					array1.sortOn('value', 0);
				else
					array1.sortOn('value', _debugCompareCounter);
				trace('Array.sortOn', array1.length, 'numbers;', (getTimer() - start) / 1000, 'seconds;', _debugCompareCount ? (_debugCompareCount+' comparisons') : '');
				
				start = getTimer();
				_debugCompareCount = 0;
				sortImmediately(array2, _debugCompareFunction);
				//trace('Merge Sort', n, 'numbers;', _immediateSorter.elapsed / 1000, 'seconds;',_debugCompareCount,'comparisons');
				trace('Merge SortOn', array2.length, 'numbers;', (getTimer() - start) / 1000, 'seconds;', _debugCompareCount ? (_debugCompareCount+' comparisons') : '');
				

					for (var i:int = 0; i < n; i++)
					{
						var value:*;
						if (testType == 0) // random integers
							value = uint(Math.random()*100);
						else if (testType == 1) // random integers and NaNs
							value = Math.random() < .5 ? NaN : uint(Math.random()*100);
						else if (testType == 2) // random strings
							value = 'a' + Math.random();
						
						array.push(value);
