Problem with Ultrasound sensor code

Servo servoR, servoG;

long red = 0, green = 0, blue = 0, tR = 0, tG = 0, tB = 0;
bool counterR = false, counterB = false, counterG = false;
int potentio, beltM, angV, redSen, greenSen, blueSen;
double v;
long timeR, timeG, timeB;
void setup()
  
{
  Serial.begin(9600);
  
}

void loop()
{
  
  pinMode(6,OUTPUT);
  digitalWrite(6,HIGH);
  delayMicroseconds(15);
  digitalWrite(6,LOW);
  pinMode(6,INPUT);

  timeR = pulseIn(6,HIGH);
  redSen = 0.0344*timeR/2;
  
  //Serial.println(redSen);
  //Serial.println(red);
  
  pinMode(5,OUTPUT);
  digitalWrite(5,HIGH);
  delayMicroseconds(5);
  digitalWrite(5,LOW);
  pinMode(5,INPUT);
  
  timeG = pulseIn(5,HIGH);
  greenSen = 0.0344*timeG/2;
  
  //Serial.println(greenSen);
  //Serial.println(green);
  
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);
  delayMicroseconds(5);
  digitalWrite(4,LOW);
  pinMode(4,INPUT);
  
  timeB = pulseIn(4,HIGH);
  blueSen = 0.0344*timeB/2;
  
  Serial.println(blueSen);
  Serial.println(blue);
  
  if (redSen <= 200 & counterR == false){
    red++;
    counterR = true;
  }
  
  if (counterR == true){
   	tR++;
  }
  
  if (tR == 10){
    counterR = false;
    tR = 0;
  }
  
    if (greenSen <= 200 & counterG == false){
    green++;
    counterG = true;
  }
  
  if (counterG == true){
   	tG++;
  }
  
  if (tG == 10){
    counterG = false;
    tG = 0;
  }
  
  if (blueSen <= 200 & counterB == false){
    blue++;
    counterB = true;
  }
  
  if (counterB == true){
   	tB++;
  }
  
  if (tB == 10){
    counterB = false;
    tB = 0;
  }

  }

This is my code for the ultrasound counting system. However, when all colours (red, green and blue) are added in the code, the serial printing messes up and prints the wrong values. However, if i put the code just for 2 colours, the system works perfectly. If there some kind of limit how many if statements i can add?

Set your Compiler Warnings level to “All” in Preferences.

/Users/john/Documents/Arduino/sketch_nov17a/sketch_nov17a.ino: In function 'void loop()':
/Users/john/Documents/Arduino/sketch_nov17a/sketch_nov17a.ino:56:14: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   if (redSen <= 200 & counterR == false)
       ~~~~~~~^~~~~~
/Users/john/Documents/Arduino/sketch_nov17a/sketch_nov17a.ino:73:16: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   if (greenSen <= 200 & counterG == false)
       ~~~~~~~~~^~~~~~
/Users/john/Documents/Arduino/sketch_nov17a/sketch_nov17a.ino:90:15: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   if (blueSen <= 200 & counterB == false)
       ~~~~~~~~^~~~~~

Those warnings are because you used a bitwise AND (&) where you meant to use a boolean AND (&&) in three places. I don’t know if that is the only mistake but fixing it may help.

You’re probably pinging too frequently.
Slow your ping rate to no more than about 20 - 30 Hz

NOTE: You should add a 30-millisecond delay between the pulses from different sonar units to allow the echoes to dissipate. If a sensor sees an echo from an earlier pulse it will give an incorrect low distance.