[Solved, but would like clarification] Max = max + 1 confusion

I can’t seem to figure out what I am doing wrong with this particular line of code. I checked back to the video to see if all my code was the accurate. However, I keep getting the same result regarding the max value:

EDIT:
Was able to fix the problem by closing and reopening Unity/MonoDevelop, but what made this work?

Are you sure you saved the script before running? If not, it’s possible that when you closed monodevelop it made you save the file, hence why it worked the next time you tried.

I definitely saved. Not sure what it could be