public void run(){

    for( int k = lastSteps + 1; k < maxIter; k++){
      for( int m = 0; m < maxTemp; m++ ){
        for( int j = 0; j < maxStep; j++ ) {
          for( int h = 0; h < dim; h++){
            // Step in a random direction for each dimension.
            double f = obj.eval();
            double r = randomStepScale();
            while( ! obj.inBounds(h, r * v[h] ) ){
              r = randomStepScale();
            }
            obj.step( h, r * v[h] );
            double fp = obj.eval();
            decide( f, fp, h);
          }
        }

         // This is where we update the step vector.
          for( int u = 0; u < v.length; u++ ){
            double n = (double) obj.getAcceptCount( u );
            if( n > 0.6 * maxStep ){
              v[ u ] = Math.min( v[ u ] + (v[u] * 2 * n / (0.4 * maxStep)) - (1.5 * 2 * v[ u ]), 
                                maxStepLength );
            }
            else if( n < 0.4 * maxStep ){
              v[ u ] = Math.max( v[u] / ( 1 + 2 - (n / (0.4 * maxStep) )), 
                                 minStepLength );
            }
          }
          obj.reset();


        reduceTemp();
      }
      //Update value history and check for termination
      fHist[ k ] = obj.eval();
      if( hasConverged( k ) )
        break;
      else
        obj.set( xOpt );
    }
  }