Serial Print makes code work. Why?

Thanks J-M-L

Too say I'm a novice at coding is a huge overstatement so I appreciate the tip. I found this bit of code on the web and modified it to work the way I needed to.

I did add in title's to the remaining 4 buttons but that didn't make it work without having to add the serial.print() to the code.