 		}
 		
 		/**
+		 * This is a basic compare function similar to the default compare used by Array.sort().
+		 * This function is faster than ObjectUtil.compare(), but does not do deep object compare.
+		 */
+		private static function defaultCompare(a:*, b:*):int
+		{
+			if (a === b)
+				return 0;
+			if (a == null)
+				return 1;
+			if (b == null)
+				return -1;
+			var typeA:String = typeof(a);
+			var typeB:String = typeof(b);
+			if (typeA != typeB)
+				return ObjectUtil.stringCompare(typeA, typeB);
+			if (typeA == 'boolean')
+				return ObjectUtil.numericCompare(Number(a), Number(b));
+			if (typeA == 'number')
+				return ObjectUtil.numericCompare(a as Number, b as Number);
+			if (typeA == 'string')
+				return ObjectUtil.stringCompare(a as String, b as String);
+			if (a is Date && b is Date)
+				return ObjectUtil.dateCompare(a as Date, b as Date);
+			return 0;
+		}
+		
+		/**
 		 * This is the sorted Array (or Vector), or null if the sort operation has not completed yet.
 		 */
 		public function get result():*
 		{
-			return size >= length ? array : null;
-		}
-		
-		private var compare:Function;
-		private var array:*;
-		private var length:uint;
-		private var size:uint;
-		private var start:uint;
-		private var middle:uint;
-		private var end:uint;
-		private var iLeft:uint;
-		private var iRight:uint;
-		private var iBuffer:uint;
-		private var buffer:*;
-		private var merging:Boolean;
-		private var swapped:Boolean;
-		private var elapsed:int;
-		private var _immediately:Boolean = false;
+			return source ? null : original;
+		}
+		
+		private var original:*; // original array
+		private var source:*; // contains sub-arrays currently being merged
+		private var destination:*; // buffer to store merged sub-arrays
+		private var compare:Function; // compares two array items
+		private var length:uint; // length of original array
+		private var subArraySize:uint; // size of sub-array
+		private var middle:uint; // end of left and start of right sub-array
+		private var end:uint; // end of right sub-array
+		private var iLeft:uint; // left sub-array source index
+		private var iRight:uint; // right sub-array source index
+		private var iMerged:uint; // merged destination index
+		private var elapsed:int; // keeps track of elapsed time inside iterate()
+		private var _immediately:Boolean = false; // set in sortImmediately(), checked in beginSort()
 		
 		/**
 		 * This will begin an asynchronous sorting operation on the specified Array (or Vector).

			
			while (getTimer() < stopTime)
			{
				if (iLeft < middle)
				{
					// copy smallest value to buffer
					if (iRight < end && compare(array[iRight], array[iLeft]) < 0)
						buffer[iBuffer++] = array[iRight++];
					else
						buffer[iBuffer++] = array[iLeft++];
				}
				else if (iRight < end)
				{
					buffer[iBuffer++] = array[iRight++];
				}
				else if (end >= length) // done merging all pairs of sub-arrays of current size
				{
					// swap sorted and unsorted arrays
					var sorted:* = buffer;
					buffer = array;
					array = sorted;
					swapped = !swapped; // keep track of whether or not this is the original array
					
					// start again from beginning of array
					size *= 2;
					end = 0;
					
					if (size >= length)
					{
						// we are done sorting.
						elapsed += getTimer() - time;
						if (swapped)
						{
							// buffer is the original, so copy the sorted values over from sorted array
							for (var i:int = length - 1; i >= 0; i--)
								buffer[i] = array[i];
							array = buffer;
						}
						buffer = null;
						return 1;
					}
				}
				else
				{
					// prepare for next merge
					start = end;
					middle = Math.min(start + size, length);
					end = Math.min(middle + size, length);
					iLeft = start;
					iRight = middle;
					iBuffer = start;
					merging = true;
				}
			}
			
			elapsed += getTimer() - time;
			
			if (length == 0)
				return 1;
			
			//TODO: improve progress calculation
			return size / length; // not exactly accurate, but returns a number < 1
		}
		
		private function done():void

		{
		}
		
		private static var _immediateSorter:AsyncSort; // used by sortImmediately()
		
		/**
		 * This function will sort an Array (or Vector) immediately.
