Using Adafruity Microphone Amplifier, Error Messages in Code

The program is returning an “expected constructor, destructor, or type conversion before ‘=’ token.” I am a relative beginner doing a project for a class assignment, and I have attempted to debug to the best of my ability, but I continue to see this error. Thanks

const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
int led = 5;
int led2 = 1;
int led3 = 0;
unsigned int sample;
unsigned int sample2;
unsigned int sample3;
unsigned long startMillis= millis(); // Start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level
unsigned int peakToPeak2 = 0;
unsigned int peakToPeak3 = 0;
unsigned int signalMax = 0;
unsigned int signalMax2 = 0;
unsigned int signalMax3 = 0;
unsigned int signalMin = 1024;
unsigned int signalMin2 = 1024;
unsigned int signalMin3 = 1024;
 

void setup()
{
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  analogWrite(0, INPUT);
  analogWrite(2, INPUT);
  analogWrite(3, INPUT);
  Serial.begin(9600);
}
 
 
void loop()
{

// collect data for 50 mS
while (millis() - startMillis < sampleWindow)
{
sample = analogRead(0);
if (sample < 1024.0) // toss out spurious readings
{
if (sample > signalMax)
{
 signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
 signalMin = sample; // save just the min levels
}
}
}
peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude
double volts = (peakToPeak * 3.3) / 1024; // convert to volts
Serial.println(volts);
while (millis() - startMillis < sampleWindow) { 
double sample2 = analogRead(2);
if (sample2 < 1024.0) // toss out spurious readings
{
if (sample2 > signalMax2)
{
 signalMax2 = sample2; // save just the max levels
}
else if (sample2 < signalMin2)
{
 signalMin2 = sample2; // save just the min levels
}
}
}
peakToPeak2 = signalMax2 - signalMin2; // max - min = peak-peak amplitude
double volts2 = (peakToPeak2 * 3.3) / 1024; // convert to volts
Serial.println(volts2);

double sample3 = analogRead(3);
if (sample3 < 1024.0) // toss out spurious readings
{
if (sample3 > signalMax3)
{
  signalMax3 = sample3; // save just the max levels
}
else if (sample3 < signalMin3)
  {
    signalMin3 = sample3; // save just the min levels
  }
}
}
peakToPeak3 = signalMax3 - signalMin3; // max - min = peak-peak amplitude
double volts3 = (peakToPeak3 * 3.3) / 1024; // convert to volts
Serial.println(volts3);
}

I get

sketch_feb27a.ino: In function ‘void loop()’:
sketch_feb27a:52: error: expected `}' at end of input

Yes I cut some off sorry. That problem should be fixed now.