Two Buttons, two inputs - DigitalRead not working

Hello. I'm working on a project that involves two switches an a push counter. I want one switch to increase the number the counter is at, while the other should decrease it. I used the buttonState change code found here but modified it a bit to work with my project. I added the second button input and removed the LED. I'm testing my code out now with buttons, but every time I pull up the serial monitor, there's no information. At one point it did read "number of button pushes: 0", but wouldn't change after that. Then it just stopped printing out any information whatsoever. Here's my code:

 const int  buttonPin1 = 2; // the pin that the pushbutton is attached to
const int buttonPin2 = 4;


// Variables will change:
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState1 = 0;         // current state of the button
int lastButtonState1 = 0;    // previous state of the button

int buttonState2 = 0;
int lastButtonState2 = 0;

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin1, INPUT);
  // initialize the LED as an output:
  pinMode(buttonPin2, INPUT);
  // initialize serial communication:
  Serial.begin(9600);
}


void loop() {
  // read the pushbutton input pin:
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);

  // compare the buttonState to its previous state
  if (buttonState1 != lastButtonState1) {
    // if the state has changed, increment the counter
    if (buttonState1 == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:
      buttonPushCounter++;
    }
      
      if (buttonState2 != lastButtonState2) {
        if (buttonState2 == HIGH) {
          buttonPushCounter--;
          
      Serial.println("on");
      Serial.print("number of button pushes:  ");
      Serial.println(buttonPushCounter);
    } 
    else {
      // if the current state is LOW then the button
      // wend from on to off:
      Serial.println("off"); 
    }
  }
  // save the current state as the last state, 
  //for next time through the loop
  lastButtonState1 = buttonState1;
  lastButtonState2 = buttonState2;

  

}
  }

as you can probably guess, I'm new to this, so I apologize if my error is some big oversight. It could also be in my circuit, if you follow the link to arduino's site, it looks like that except I added a second button. If you need any more information let me know.

Thank you so much!

thanks, I'll try all this out!!!

Go back through and pay careful attention to where the brackets are and where each block begins and ends.

Set your mouse cursor on starting bracket ( { ) and click it.
The code block will highlight ( yellow ) or the code block end bracket will be indicated.
It works little erratically.

Use Auto Format(er) and add more tracking Serial prints so you have an indicator of your code flow.

The code block will highlight ( yellow ) or the code block end bracket will be indicated.

Here single click highlights the matching brace/bracket whilst double click selects the start and end braces/brackets and all the code between them.

Windows 7
IDE 1.5.6-r2

UKHeliBob:
Here single click highlights the matching brace/bracket whilst double click selects the start and end braces/brackets and all the code between them.

Windows 7
IDE 1.5.6-r2

Finally someone who knows about this.
Been using it for a while and don't remember where it is documented.

I keep saying it is unreliable because sometime when I single click on { the cursor just moves past the bracket and sometime it highlights the block.
And on occasion the start bracket gets highlighted in yellow and the end bracket just gets blue frame around it which is easy to miss.
Sometime it even works in reverse - from end bracket to start. Just weird.

I am used to this inconsistency , but it would be nice it it was consistent - yellow highlight both start and end of the block.

Actually the double click to highlight the whole block is most useful (to me).