 {
   void lowerRightRoom(){
   turn(0); //turn(0) is a way to reset gyro measurements
-  
+
   turn(-20); //turn the robot 45, but since it's so close to the wall, this needs to happen gradually
   moveForward();
   delay(1000);


}

while(followdirection >= 9) 
{
  if (frontultrasonic.getdistance() > closeToWall && lefttultrasonic.getdistance() < closeToWall)
  {
    moveslightright();
    delay(500);    //move left diagnal
    moveslightleft().wait(leftultrasonic.getdistance() < closeToWall);
    delay(500);
  }
  
  else if (leftultrasonic.getdistance() > 2 && frontultrasonic.getdistance() > 2)
  {
    turn(90);    
    delay(500);
    followdirection = followdirection + 1;
  }
  else if (leftultrasonic.getdistance() < 2 && frontultrasonic.getdistance() < 2)
  {
    turn(-90);   
    delay(500);
    followdirection = followdirection + 1;
  }
}

  

  turn(-25);

  moveForward(diagonalMove);

  turn(0);
  turn(-90);
  delay(1000);  //see if there's fire in the upper corner
