'Serial' does not name a type

We created a sketch and we uploaded it and it worked for us. We altered the sketch to change a digitalWrite number and now we get a 'Serial' does not name a type error message. Please advice how to fix it.

int x;
void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT);
pinMode(4, OUTPUT);pinMode(5, OUTPUT);
pinMode(6, OUTPUT);pinMode(7, OUTPUT);
pinMode(8, OUTPUT);pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
}

void loop() {
if (Serial.available() != 0)
x = Serial.read();
}
Serial.println(x);
switch (x) {
case 32://'Spacebar' Turns Everything Off
digitalWrite(9, LOW);
digitalWrite(4, LOW);digitalWrite(5, LOW);
digitalWrite(6, LOW);digitalWrite(7, LOW);
digitalWrite(8, LOW);digitalWrite(11, LOW);
digitalWrite(10, LOW);
break;
case 119://'w' Motors #1,2,3,4 Move Upward. (Change so that all 4 motors Turn on at once.)
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
break;
case 113://'q' Motors #1,2,3,4 OFF.(Sink)
digitalWrite(9, LOW);
digitalWrite(10,LOW);
break;
case 97://'a' Motor #5 Turn Right.
digitalWrite(8, HIGH);
case 122://'z' Motor #5 OFF.
digitalWrite(8, LOW);
break;
case 100://'d' Motor #6 Turn Left.
digitalWrite(7, HIGH);
case 99://'c' Motor #6 OFF.
digitalWrite (7, LOW);
case 102://'f' Vex Motor Open.
digitalWrite (6, HIGH);
case 103://'g' Vex Motor Closed.
digitalWrite (6, LOW);
break;

}

The code is incomplete, and missing code tags

void loop() {
  if (Serial.available() != 0)
    x = Serial.read();
  }

Oops

You have an errant }

I leave it to you as an exercise to find it!

By the way, the error location is quite obvious if you bother to look at it more carefully.

.