 		
 		private var _previousSortedValues:Array = [];
 		private var _sortedValues:Array = [];
-		private var _mat1:Array = [];
-		private var _mat2:Array = [];
+		
 		private var _count:int = 2;
 		private var _m:Number = 0;
-		private var _v:Number = 0;
-		private var _s1:Number = 0;
-		private var _s2:Number = 0;
+		private var _p:Number = 2;
+		
+		// the variance, as computed at each step in the calculation
+		private var _variance:Number = 0;
+		
+		// `SZ` originally. this is the sum of the values seen thus
+		// far when calculating variance.
+		private var _sum:Number = 0;
+		
+		// `ZSQ` originally. the sum of squares of values seen
+		// thus far
+		private var _sum_squares:Number = 0;
+		// `WT` originally
 		private var _w:Number = 0;
-		private var _p:Number = 2;
+		
 		
 		private function _iterateJenksBreaks(returnTime:int):Number
 		{
+			// Compute the matrices required for Jenks breaks.
 			for (; _count < _sortedValues.length + 1; _count++)
 			{
 				if(_m==0)
 				{
-					_s1= 0;
-					_s2= 0;
+					_sum= 0;
+					_sum_squares= 0;
 					_w= 0;
 					_m =1;			
 				}

					{
						return _count/(_sortedValues.length+1);
					}
					var i3:Number = _count - _m +1;
					var val:Number = _sortedValues[i3-1];
					
					_s2 += val * val;
					_s1 += val;
					
					_w += 1;
					_v = _s2 - (_s1 * _s1) / _w;
					var i4:Number= i3 -1;
					if(i4 !=0)
					{
						_p = 2;
						for (; _p < numOfBins.value + 1; _p++)
						{
							
							if((_mat2[_count][_p]) >= (_v + _mat2[i4][_p-1]))
							{
								_mat1[_count][_p] = i3;
								_mat2[_count][_p] = _v +_mat2[i4][_p-1];
							}
						}
					}
				}
				_m = 0;
				_mat1[_count][1] = 1;
				_mat2[_count][1] = _v;
			}
			return 1;
		}

				kClass.push(0);
			}
			
			// the calculation of classes will never include the upper and
			// lower bounds, so we need to explicitly set them
			kClass[countNum] = _sortedValues[_sortedValues.length -1];
			
			kClass[0] = _sortedValues[0];
			
			
			// the lower_class_limits matrix is used as indexes into itself
			// here: the `kClassCount` variable is reused in each iteration.
			while (countNum >=2)
			{
				var id:Number = _lower_class_limits[kClassCount][countNum] -2;
				kClass[countNum -1] = _sortedValues[id];
				kClassCount = _lower_class_limits[kClassCount][countNum] -1;
				countNum --;
			}
			
