           continue;
         } /* end if */
 
+        alphas[i] = alphas[i] + y[i] * y[j] * ( alphaJOld - alphas[j] );
+
+
         float b1 = b - E[i]
                      - y[i] * (alphas[i] - alphaIOld) * 
                             K[INDX(i,j,trainingSize)]
                      - y[j] * (alphas[j] - alphaJOld) * 
                             K[INDX(i,j,trainingSize)];
 
+        float b2 = b - E[j]
+                     - y[i] * (alphas[i] - alphaIOld) * 
+                            K[INDX(i,j,trainingSize)]
+                     - y[j] * (alphas[j] - alphaJOld) * 
+                            K[INDX(j,j,trainingSize)];
+
+
+
+        if( 0.0f < alphas[i] && alphas[i] < C ) b = b1;
+        else if( 0.0f < alphas[j] && alphas[j] < C ) b = b2;
+        else b = (b1 + b2) / 2.0f;
+
+
+        numChangedAlphas = numChangedAlphas + 1;
+
+//        printf("numChangedAlphas %d\n",numChangedAlphas );
 
       } /* end if */
 
-      exit(911);
     } /* end for i */ 
+   
+    if( numChangedAlphas == 0 ) passes = passes + 1;
+    else passes = 0; 
+
+    printf("b = %f\n",b);
+
+    fprintf(stdout,".");
+    dots = dots + 1;
+    if( dots > 78 )
+    {
+      dots = 0;
+      fprintf(stdout,"\n");
+    } 
+    
+   
   } /* end while */
+
+  printf("b is %f\n");
 
   free(E); 
   free(alphas);

          H = min( C, C + alphas[j] - alphas[i] );
        } /* end else */

        if( L == H ) continue;

        eta = 2.0f * K[INDX(i,j,trainingSize)] 
                   - K[INDX(i,i,trainingSize)] 
                   - K[INDX(j,j,trainingSize)];

        if( eta >= 0.0f ) continue;


        while( j == i ) 
          j = ceil( (float) trainingSize * 
                      float( rand() ) / ( float(RAND_MAX) + 1.0f ) );
//        j = 3918;
 //       printf("j is %d\n",j);

        for( int k = 0; k < trainingSize; k++ )
        {  
