           pastNear = true; // opponent was near in the past
           attackCount = 0;
         } else if (lineFlag == 0) {
-          if ((abs(rightDist - leftDist) <= 150)
+          if ((abs(rightDist - leftDist) <= dist)
                 || ((past == 'f' || searchCount >= 100) && (rightDist > far && leftDist > far && perRightDist > far && perLeftDist > far))) {
             //if (robot moved forward in the past OR it's been searching for 100 iterations) AND (there isn't an object within far of any IR sensor))
             //move forward

      prevFlag = cur;
      pivotFlag = false;
      pastNear = false;
    } else if ((cur - prevIR) >= 25) {
      // otherwise, poll all the distance sensors
      prevIR = cur;
      rightDist = sensor.getDist();

          attackCount = 0; // clear attack counter
          state = 0;
          pastNear = true;
        } else if ((expectedVelL > gelVelL() + hallTimeThresh || expectedVelR > getVelR() + hallTimeThresh) && pastStalled && cur - stalled <= stallThresh) {
          past = 'f';
          state = 1;
          attackCount++; // increment attack counter
          pastNear = true;
        } else if (perLeftDist <= near) {
          //if opponent within near of the left peripheral sensor, spin left
          state = 4;
          past = 'l'; // set past movement to left
