pert:
Do a Tools > Auto Format on your code and then check the automatic indentation to make sure it matches your intended program structure.
It is pointless to suggest using Tools + Auto Format, when there is clearly mis-matched curly braces. Tools + Autp Format won't work when the number of { and the number of } are not equal.