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

					_testArraysSortOn.push(arraySortOn);
				}
			}
			trace("testType =", testType);
		}
		public static function test(compare:Object, testType:int = 0):void
		{

					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);
